Skip to content

Document and test extension integration - #3

Draft
MiguelsPizza wants to merge 1 commit into
alex/execute-toolfrom
alex/strict-polyfill
Draft

MiguelsPizza wants to merge 1 commit into
alex/execute-toolfrom
alex/strict-polyfill

Conversation

@MiguelsPizza

@MiguelsPizza MiguelsPizza commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

WIP - currently having some AI's do reviews. Below is AI generated

this adds a guide for dropping the polyfill into an existing extension, on top of #2. It covers installing the built bundle as a MAIN-world content script at document_start, discovering and invoking through scripting.executeScript so the browser carries results back without a page-message protocol, and forwarding toolchange into the isolated world as a payload-free DOM event. The guide is explicit that those events are hints and never an authorization boundary, since MAIN-world code shares the page's globals.

The test lifts the guide's two JavaScript blocks, wraps them in an MV3 extension, and runs it against a real served page in Chromium and in stock Firefox over geckodriver, covering discovery, execution, unregister and re-register, reload, and a non-matching origin. Firefox runs the same chrome.scripting code through Selenium, because Playwright loads extensions only in Chromium. Extraction depends on the guide having exactly two js blocks in that order plus two literal markers, so the test asserts the extraction itself: editing EXTENSIONS.md fails in a second with a message naming the file instead of timing out somewhere inside a 90-second extension run.

All 102 browser tests and the package checks pass; WPT is unchanged from #2, same five expected failures. That closes the stack.

@MiguelsPizza
MiguelsPizza force-pushed the alex/execute-tool branch 2 times, most recently from a8d5c56 to ad06f90 Compare September 14, 2026 21:43
@MiguelsPizza
MiguelsPizza force-pushed the alex/strict-polyfill branch 2 times, most recently from 5db059a to ac50a41 Compare September 14, 2026 21:48
@MiguelsPizza
MiguelsPizza force-pushed the alex/execute-tool branch 2 times, most recently from f757b99 to f2e95de Compare September 15, 2026 16:38
Document MAIN-world installation, discovery and invocation through the browser's scripting API, and forwarding toolchange into the isolated world as a payload-free DOM event. The guide is explicit that those events are hints rather than an authorization boundary, since MAIN-world code shares the page's globals.

The test builds an MV3 extension out of the guide's own JavaScript blocks and runs it against a real served page in Chromium and in stock Firefox over geckodriver, so the documented example cannot drift from working code. Assert the extraction itself, so editing the guide fails here rather than in a poll timeout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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