8000 GitHub - iniyan/anchor-view: Anchor View — draggable always-on-screen SEO panel (MV3, Shadow DOM) · GitHub
[go: up one dir, main page]

Skip to content

About

Anchor View — draggable always-on-screen SEO panel (MV3, Shadow DOM)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Anchor View — draggable always-on-screen SEO panel (MV3, Shadow DOM)

Laptop / split-screen-first SEO overlay. Minimal audit scope on purpose — the differentiator is the display mechanism, not audit depth.

Why Shadow DOM + empty css in manifest

  • content_scripts[].css is intentionally []. Zero global stylesheets are injected into host pages.
  • All overlay CSS lives in a <style> tag inside host.attachShadow({mode:"open"}) at runtime (content.js: CSS const). The host element itself gets all: initial !important + fixed zero-size positioning, and the visible panel/badge use classes prefixed av- that only exist inside the shadow tree.
  • Result: host-page resets (Tailwind preflight, * { margin: 0 }, Bootstrap, overflow: hidden containment on body) cannot restyle the panel, and the panel cannot restyle the host page. Verified by checking computed styles of host-page nodes before/after injection — no deltas.

Drag / resize / persist model

  • Panel is position: fixed inside the shadow root; header (data-drag) moves it, corner grip (data-resize) resizes it (min 240×200).
  • Snap-to-edge: within 24px of a viewport edge the panel snaps flush so it can never be dragged fully off-screen (the core Keyword-Surfer complaint).
  • Persist: debounced 250ms writes to chrome.storage.local.overlaySettings = { mode, positions, collapsedByDefault }. mode: "per-site" keys positions by location.hostname; "global" uses one shared slot. Switching modes in the overlay settings re-seeds/re-clamps immediately; chrome.storage.onChanged syncs open tabs.
  • Hide temporarily: Hide button or Alt+Shift+A; a small Show SEO restore tab stays docked at the right edge. Esc collapses to badge.

Compact (badge) mode

  • Below ~500px viewport width the overlay auto-compacts to a draggable SEO + pass/warn/fail dot pill (autoCompact); full panel returns when the window widens, unless the user explicitly collapsed.
  • Manual collapse (– button) and badge click expand/collapse without losing position — badge is anchored to the same persisted {x, y}.
  • Scoring: fail = missing title / zero H1 / alt < 50%; warn = title not 30–60 chars, meta missing/outside 120–160, H1 > 1, alt < 90%, words < 300; else pass.

z-index + containment notes

  • Host + panel + badge use z-index: 2147483647 (max safe int) so the overlay paints above cookie banners, sticky headers, chat widgets.
  • position: fixed inside a shadow root attached to <html> (not a nested container) avoids clipping by ancestor overflow: hidden / CSS containment. Edge case: pages that apply transform/filter to <html> break fixed positioning per spec — the 2s bounds-guard + resize re-validation re-clamps into view, and Hide hotkey is the escape hatch.
  • On resize, visualViewport.resize, window-move poll (screenX/screenY), and storage change, revalidate() clamps {x,y,width,height} into the live viewport. Never off-screen down to 400px (below 500px = badge by design).

Minimal audit shown in panel

Title (+length) · meta description (+length) · H1 count · word count · image alt-coverage % (withAlt/total) · PASS/WARN/FAIL status line. Re-runs on load, +1.5s, SPA navigations, and debounced DOM mutations.

RTL / Tamil QA note

  • Panel forces direction: ltr + unicode-bidi: isolate on its own root so RTL host pages don't mirror the overlay controls; audited page content (Tamil titles/metas, e.g. Kalki Online) is displayed as-is with overflow-wrap: anywhere and counted with Unicode-aware [...str].length.
  • QA: open a Tamil article page, drag/resize/compact the panel, confirm Tamil title/meta glyphs render unclipped and counts look sane.

Install (unpacked)

  1. chrome://extensions → enable Developer mode → Load unpacked → select this anchor-view/ folder.
  2. Open any site; panel appears top-right-ish (persisted spot thereafter).
  3. Drag header / resize grip / collapse / Alt+Shift+A to exercise states.

About

Anchor View — draggable always-on-screen SEO panel (MV3, Shadow DOM)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0