Drop the chrome.extension shim now that the controller targets MV3 - #2
Open
InventivetalentDev wants to merge 1 commit into
Conversation
util/mv3-compat.js restored chrome.extension.onMessage/sendMessage/getURL
for the bundled inject/controller submodule, which still called them. The
submodule now uses chrome.runtime directly, so the shim and its injection
ahead of pageController.js can go.
The submodule pointer moves to that commit, which also fixes the key
simulation: it appended an inline <script> to the page, and MV3 applies
the extension's CSP ("script-src 'self'") to scripts a content script
injects, so it was refused on every site. Without this bump the extension
connects and controls nothing.
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.
Stacked on #1 — this targets that PR's branch, so the diff here is just the follow-up commit. Merging it updates #1.
Companion to RemoteSlide/RemoteSlide-Controller#1.
What changes
util/mv3-compat.jsrestoredchrome.extension.onMessage/sendMessage/getURLfor the bundledinject/controllersubmodule, which still called them. The submodule now useschrome.runtimedirectly, so the shim and its injection ahead ofpageController.jscan go — the "can be removed once that submodule is migrated" note in #1.The submodule pointer moves to that commit. That bump is not optional: it also carries the key-simulation fix, and without it removing the shim leaves the extension broken.
Why the submodule bump matters on its own
simulateKeyEventin the controller appended an inline<script>to the page. MV3 applies the extension's own CSP (script-src 'self') to scripts a content script injects, so it is refused — on every site, not just ones with a strict CSP of their own. Verified by loading this extension unpacked against a page serving no CSP header at all:So on #1 as it stands the extension connects, shows a green badge, and controls nothing. The controller PR has the detail and the fix.
Verification
Extension loaded unpacked in Chromium at this commit:
The MV3 service worker registers,
importScripts("sessionGrabber.js")resolves,chrome.browserActionis correctly absent, and theOffscreenCanvas/createImageBitmap/FileReaderglobals the rewrittenresizeImagedepends on are all present in the worker.Merge order
RemoteSlide/RemoteSlide-Controller#1 should land first — the pointer here references a commit on that PR's branch. It is reachable either way, but pointing
master's submodule at an unmerged branch commit is worth avoiding.Generated by Claude Code