Skip to content

✨ feat(chrome-extension): add Chrome extension for converting and filtering pages with mq - #2152

Merged
harehare merged 10 commits into
mainfrom
feat/chrome-extension
Aug 9, 2026
Merged

✨ feat(chrome-extension): add Chrome extension for converting and filtering pages with mq#2152
harehare merged 10 commits into
mainfrom
feat/chrome-extension

Conversation

@harehare

@harehare harehare commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Adds packages/mq-chrome-extension, a Manifest V3 side-panel extension built with wxt + React on top of mq-web (WASM). It converts the current page to Markdown, runs mq queries against it with copy support, and can toggle a sandboxed on-page preview of the filtered result via chrome.scripting, without ever touching the host page's live DOM.

Also wires up justfile recipes (chrome-extension, build-chrome-extension) and documents installation in install.md and the root README.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

@harehare
harehare force-pushed the feat/chrome-extension branch from 5814887 to a8f64ac Compare August 4, 2026 15:07
@harehare
harehare marked this pull request as ready for review August 7, 2026 07:46
…tering pages with mq

Adds packages/mq-chrome-extension, a Manifest V3 side-panel extension built
with wxt + React on top of mq-web (WASM). It converts the current page to
Markdown, runs mq queries against it with copy support, and can toggle a
sandboxed on-page preview of the filtered result via chrome.scripting,
without ever touching the host page's live DOM.

Also wires up justfile recipes (chrome-extension, build-chrome-extension)
and documents installation in install.md and the root README.
…edesign

- Add an HTML tab alongside Markdown in the source pane; queries can run
  directly against the extracted raw HTML via mq's html input format,
  using the same selectors as Markdown.
- Restyle the side panel (header, tabs, buttons, panes) to feel closer to
  the mq-playground look.
- Fix activeTab re-grant reliability: open the side panel from
  action.onClicked instead of setPanelBehavior({ openPanelOnActionClick }),
  since that suppresses onClicked and made re-clicking the icon to
  re-grant access on a new tab unreliable.
- Surface the underlying error when tab access fails, instead of only the
  generic permission message.
…yntax highlighting

Restyle the side panel with the playground's color palette, header
logo, and Montserrat/JetBrains Mono fonts, and let the Source/Result
panes fill the available height instead of leaving dead space below.

Replace the plain textareas with CodeMirror 6 editors: Markdown/HTML
highlighting via @codemirror/lang-markdown and @codemirror/lang-html,
and a custom StreamLanguage for mq queries ported from the
playground's Monarch tokenizer, sharing one light/dark highlight
style across all three editors.
@harehare
harehare force-pushed the feat/chrome-extension branch from 04fb605 to 26d7fb2 Compare August 8, 2026 13:56
Extract the active tab's HTML/Markdown when the panel mounts instead
of requiring a manual button press, reducing the extension's baseline
interaction cost. The "Extract page" button remains for re-extracting
after navigating or reloading.
Reduce header padding/logo/title size and drop the subtitle line so
the source, query, and result panes get more vertical room. Also fix
the CodeMirror editors shrinking to fit their pre-wrapped content
width instead of filling the pane, most visible as a narrow box that
grew with the query text.
drawSelection() hides the native caret and draws its own .cm-cursor
overlay, which defaults to a hardcoded black border since the editor
was never marked as a dark theme. Override its color to follow the
app's --fg variable so it stays visible against the dark panel
background.
Chrome's side panel chrome already shows the extension icon and
name, so the logo/title header duplicated that and ate vertical
space. Drop it and its now-unused CSS variables so the source,
query, and result panes get the room.
…smatching its background

The active-line highlight tints the current line with a faint blue
mix, which is unnoticeable across many lines but colors almost the
entire box for the mostly single-line query editor, making it look
like a different background than the panel around it. Add a
highlightActiveLine prop to CodeEditor and disable it for the query
editor, where highlighting "the current line" isn't useful anyway.
Placeholder text at full --muted color reads too close to real
content, making it hard to tell apart. Dial it down with opacity so
it reads clearly as a hint.
…eedback

The Copy button gave no indication a click did anything. Flip its
label to "Copied!" and highlight it green for 1.5s after a
successful clipboard write, reverting automatically, instead of a
blocking alert.
@harehare
harehare merged commit 1121655 into main Aug 9, 2026
10 checks passed
@harehare
harehare deleted the feat/chrome-extension branch August 9, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant