Tab-switching kills reading comprehension. You're mid-article, hit a term you half-know, open a new tab, read, come back, and the thread you were following is gone. Skip the term and you finish with a shallow read. I wanted inline lookup — highlight, read, dig deeper — without any context switch.
The hard part wasn't the lookup. It was building a tooltip that renders correctly on every page without fighting the host page's CSS or fonts.
Why not an iframe
Iframes isolate styles, which sounds like what you want. The problem is font inheritance: iframe content renders in a separate browsing context, so it can't pick up the host page's loaded fonts. You either bundle your own fonts (extension bloat) or accept FOUC on every page. Stacking context is also a fight — absolutely positioned iframes conflict with host elements that have high z-index, and there's no clean way to inspect and beat a host's stacking context from inside an iframe.
Shadow DOM gives you a closed style boundary — host CSS doesn't leak in, extension CSS doesn't leak out — while staying in the same rendering context. Font inheritance works. The tooltip doesn't reflow the page.
The one real gotcha: z-index inside shadow DOM still participates in the host's stacking context. The fix is to set it on the shadow host element itself, not inside the shadow root. I use z-index: 2147483647 on the host element and haven't hit a conflict on any page since.
What rabbitholes does
Highlight any text, get an explanation from Claude Haiku 4.5 rendered in a shadow-DOM tooltip next to your cursor. Click any word in the explanation to explore it. Drag across words to pick a phrase. Every answer ends with two suggested rabbit-hole topics. A counter tracks how many hops deep you've gone.
A globe icon re-answers the query with Brave Search results added, with source chips. A pencil icon opens a free-form follow-up that inherits current context.
All requests go directly from the browser to api.anthropic.com and api.search.brave.com — no intermediary server, no analytics, no telemetry. Manifest V3. API key in chrome.storage.sync.
Top comments (0)