Repository navigation
feat: ask Dewee about selected page text - #16
Merged
Merged
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://*/*in the click and registers the page script at runtime; turning it off unregisters it.storage.localis limited to extension pages where Chrome supports it.host_permissionsfor the runtime script is removed in a manifest hook, so install still asks for nothing broad.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) andpnpm buildhost_permissions;content-scripts/ask-dewee.jsis presentCloses #14
🤖 Generated with Claude Code