Skip to content

feat: ask Dewee about selected page text - #16

Merged
mrgoonie merged 4 commits into
mainfrom
feat/14-ask-dewee
Oct 13, 2026
Merged

mrgoonie merged 4 commits into
mainfrom
feat/14-ask-dewee

Conversation

@mrgoonie

Copy link
Copy Markdown
Contributor

Summary

  • Opt-in setting Ask Dewee on selected text (Settings → Chat display). Turning it on requests https://*/* in the click and registers the page script at runtime; turning it off unregisters it.
  • Selecting text on an https page shows a small button in a closed shadow root. Clicking it opens the side panel and puts the quoted selection, page title and address into the composer as an editable draft. Nothing is sent until the person submits.
  • Safety: selections in inputs, text areas and editable regions are ignored; the address drops its fragment, user info and credential-like query values; page messages only reach a schema-checked selection handler and never the auth handlers; storage.local is limited to extension pages where Chrome supports it.
  • WXT's generated required host_permissions for the runtime script is removed in a manifest hook, so install still asks for nothing broad.
  • Docs: architecture, auth threat model and AGENTS.md describe the exception.

Trade-off

Turning the feature off keeps Chrome's site access, because removing https://*/* could also drop gateway origins covered by the same grant. The hint tells the person to remove it in the extension settings.

Test plan

  • pnpm lint && pnpm typecheck && pnpm test (484 tests) and pnpm build
  • Built manifest has no host_permissions; content-scripts/ask-dewee.js is present
  • Manual: enable in Settings, select text on a page, click the button, panel opens with the draft

Closes #14

🤖 Generated with Claude Code

An opt-in setting shows an "Ask Dewee" button next to text selected on
https pages. Clicking it opens the side panel and puts the quoted
selection with the page title and address into the composer as an
editable draft; nothing is sent until the person submits.

Turning the setting on requests https site access and registers the page
script at runtime; turning it off unregisters it. Selections in form
fields are ignored, credential-like query values are dropped from the
address, and messages from pages only reach the selection handler.

Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrgoonie mrgoonie self-assigned this Oct 13, 2026
mrgoonie and others added 3 commits October 13, 2026 22:54
Auth requests are now answered only for this extension's own pages; a
content script shares the extension id but carries a web URL. The page
script is registered only after storage.local is limited to extension
pages, a script left on a page after the feature is turned off can no
longer open the panel, and top-level pages are recognised by frame type.

The button ignores clicks made by page script, selections made while a
field has focus and editable areas in any letter case. More signed-URL
parameters are dropped from the address. A composer that remounts no
longer adds a draft it already used.

Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… components

Restored tabs no longer run the page script before the worker limits
storage.local again after a browser restart, and text selected while a
field inside a web component has focus is ignored. Two comments lost
characters to shell escapes and are repaired.

Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrgoonie
mrgoonie changed the base branch from feat/13-reasoning-tool-details to main October 13, 2026 16:29
@mrgoonie
mrgoonie merged commit b3cd1a0 into main Oct 13, 2026
2 checks passed
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.

Ask Dewee about selected page text

1 participant