r/chrome_extensions • • 1d ago

Sharing Journey/Experience/Progress Updates 4 quick lessons from adding snap-grid positioning, inline math, and Tab Groups. building HoverBar v0.2.0 (open-source MV3 command bar)

Post image

Quick follow-up to my post here last week on HoverBar (WXT + React 19 + MV3). Just shipped v0.2.0 with a draggable 3x3 snap grid, @ scopes (@t, @b, @h, @c, @g Tab Groups), local frequency, inline math, and an offline :emoji picker.

4 small engineering lessons from this update:

Decouple overlay anchoring from live result height

computing a draggable Shadow DOM bar'stop from its live DOM height made the input jump vertically on every keystroke as results grew/shrank. Anchoring top-*/center-* zones against a fixed nominal height (440px), switching bottom-* zones to CSS bottom anchoring, and removing a 25ms local debounce completely eliminated the jitter.

MV3 CSP vs. inline math (eval banned)

rather than pulling in a heavy math dependency for 1440 * 0.8 or 15% of 240, a ~240-line tokenizer + recursive-descent parser stays CSP-compliant, adds zero bundle bloat, and makes it trivial to ignore bare numbers/ports (3000, 127.0.0.1) so URLs don't get hijacked.

Guarding against permission creep on minor updates

i wanted to have a clipboard feature, but then skipped clipboardRead / clipboard history to avoid triggering Chrome's "extension disabled - accept new permissions" prompt on auto-update. Kept :emoji, Copy Clean URL, and Copy as Markdown at zero new permissions, added tabGroups (no extra warning beyond tabs), and feature-detectedbrowser.tabGroups at runtime for Chromium forks.

action.openPopup({ windowId }) needs a zero-arg fallback

on restricted pages (chrome://, New Tab, Web Store), passing { windowId } works much better in Chrome 127+ with multiple windows, but some Chromium builds reject the options arg. Chaining openPopup({ windowId }) -> openPopup() -> centered windows.create({ type: 'popup' }) kept it solid everywhere.

MIT open-source, zero telemetry. always!

Source: HoverBar

CWS: https://chromewebstore.google.com/detail/hoverbar-floating-search/cfpfmdmpgjciacmbfgeofdjgnkedjefl

1 Upvotes

0 comments sorted by