Architecture
How ZSpect isolates styles, pierces Shadow DOM, and stores multi-page sessions.
4-Layer Manifest V3 Runtime
[Inspected Tab — MAIN World] probe.content.ts
├── Framework X-Ray (React Fiber, Vue 3, Svelte, Astro, Angular)
├── 30s Rolling Flight Capsule + Secret Redactor
└── Web Animations API Scrubber
⇅ CustomEvent Bridge
[Inspected Tab — ISOLATED World] hud.content (Closed ShadowRoot)
├── Preact + @preact/signals 38px HUD, 316px Popover & 44px Circular FAB
└── VisBug Redline, WCAG Contrast & Undoable Tweak Engine
⇅ chrome.runtime Messaging
[Extension Service Worker] background.ts + offscreen/main.ts
├── Throttled captureVisibleTab + OffscreenCanvas Retina Cropper
└── Google Sheets 2-Way Sync Engine (drive.file OAuth + Smart Polling)
⇅ IndexedDB (ZSpectDB)
[Native Side Panel] SidePanelApp.tsx
└── Multi-Page Sessions, @ref Vault, AI Compiler & .xlsx/.zip/.md Exporters
Closed Shadow DOM & Focus-Trap Shielding
Injecting UI into arbitrary third-party websites requires strict isolation in both directions:
- pxPure Pixel Token Scale — Uses
--spacing: 4pxinside a ClosedShadowRootso host pages settinghtml { font-size: 10px }cannot shrink ZSpect's controls. - CSSInherited Property Reset — Resets
scrollbar-color,letter-spacing,text-transform, anduser-selectat the:hostboundary. - EventsModal Focus-Trap Shield — Stops bubble-phase propagation of
keydownandfocusinat the shadow host so Radix/MUI focus traps and host hotkeys never steal focus while typing notes.