Skip to content

fix(webext)!: bridge tools to the inspected page - #563

Open
SaKaNa-Y wants to merge 2 commits into
vitejs:mainfrom
SaKaNa-Y:fix/webext-inspected-page-bridge
Open

fix(webext)!: bridge tools to the inspected page#563
SaKaNa-Y wants to merge 2 commits into
vitejs:mainfrom
SaKaNa-Y:fix/webext-inspected-page-bridge

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

Vue Tracer and A11y opened from the browser extension operate on the DevTools iframe instead of the inspected app. The extension boundary also defaults to JSON messaging, which changes typed-array and map values and rejects big integers and cyclic channel payloads.

Fix

Bind the Vite panel to chrome.devtools.inspectedWindow.tabId and the injected main-frame documentId. Relay page actions and in-page channel messages through dedicated ports, validating the panel window, origin, and session. Dispose stale connections on navigation and report unsupported page bridges explicitly.

Enable native structured-clone extension messaging to preserve channel payloads. The Chromium regression exercises the production isolated-world relay through real runtime ports and checks typed arrays, big integers, maps, sets, shared references, cyclic objects, dates, and blobs in a round trip. It fails with the previous manifest and passes with the updated configuration.

Breaking

The extension requires Chrome 148 or later, where native structured-clone messaging is supported. Upgrade Chrome before installing this extension version. The manifest enforces the minimum version, and the extension README documents it.

Merge and release order

Step 2 of 2: keep this PR in draft until the upstream release and dependency upgrade are complete.

The dependency upgrade remains pending. The current dependency versions do not contain the inspected-page endpoint required by this adapter.

Companion upstream PR: devframes/devframe#363. This follows the browser extension refactor in #530.

Verification

  • pnpm lint, pnpm typecheck, and pnpm build: passed.
  • pnpm test --run: 324 passed, 2 skipped, including 13 panel tests for binding, handshakes, forwarding, navigation cleanup, and unsupported bridges.
  • pnpm -C packages/webext exec vue-tsc --noEmit and pnpm -C packages/webext build: passed.
  • pnpm -C e2e exec vitest run tests/webext-inspected-page.test.ts: passed in Chromium using real extension messaging.
  • Full Tracer/A11y UI end-to-end scenarios were not rerun in this revision; validation against the required published packages remains a release gate.

Bind the DevTools panel to its inspected tab and exact document, and relay page actions and in-page channels through dedicated ports. This lets Vue Tracer and A11y operate on the user app instead of the extension iframe.

Dispose connections on navigation and surface unsupported page bridges. Requires the companion Devframe bridge release before the downstream dependency upgrade and merge.
@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@563

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@563

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@563

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@563

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@563

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@563

commit: 8e370fb

Enable native structured-clone extension messaging and cover rich payload round trips through the inspected-page relay in Chromium.

BREAKING CHANGE: the extension now requires Chrome 148 or later. Upgrade Chrome before installing this extension version.
@SaKaNa-Y SaKaNa-Y changed the title fix(webext): bridge tools to the inspected page fix(webext)!: bridge tools to the inspected page Sep 11, 2026
@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review September 11, 2026 12:21
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