Migrate the extension to Manifest V3 - #1
Open
InventivetalentDev wants to merge 1 commit into
Open
Conversation
Manifest:
- manifest_version 3, browser_action -> action
- persistent background page -> background.service_worker
- host permissions (<all_urls>, http://*/, https://*/) moved to
host_permissions; added "scripting" for the popup's injection
- content_security_policy is now an object. MV3 forbids remote script
sources, so the remote-sli.de/cdnjs/jquery/google-analytics entries are
gone and the policy is the MV3 default
- web_accessible_resources entries carry the now-required "matches"
Background page -> service worker (background.js):
- imports sessionGrabber.js via importScripts; jQuery is dropped from the
worker ($.extend -> Object.assign) since it needs a DOM
- resizeImage() has no DOM to work with, so it decodes the capture with
createImageBitmap and scales it on an OffscreenCanvas, then serialises
through FileReader. Output is unchanged: a 40%-scale PNG payload with
the data URL header stripped
- chrome.browserAction -> chrome.action
- chrome.tabs.getSelected is gone; the badge now targets sender.tab (the
tab the controller actually runs in) and falls back to the active tab
- takeScreenshot() is promise-based and reports failures instead of
leaving the caller waiting on a response that never comes
Popup (index.js):
- chrome.tabs.getSelected -> chrome.tabs.query, via a withActiveTab helper
- chrome.tabs.executeScript -> chrome.scripting.executeScript. MV3 has no
{code: ...}, so remote_slide is handed over with func/args, and the
injections are chained so pageController.js only runs once jQuery and
socket.io are in place
- chrome.extension.onMessage -> chrome.runtime.onMessage
- chrome.browserAction -> chrome.action, and the badge calls now use the
stored controlledTab id instead of a non-existent .id on that number
Content scripts:
- chrome.extension.onMessage/getURL -> chrome.runtime equivalents in
injector.js and preziInjector.js
Other:
- util/mv3-compat.js restores chrome.extension.onMessage/sendMessage/getURL
for the bundled inject/controller submodule, which still targets MV2. It
is injected just before pageController.js and can be removed once that
submodule is migrated
- lib/analytics.js loaded ga.js from a remote origin, which MV3 does not
allow; removed along with its script tag
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TwwH67Z38ZV9GaWAtPZhfP
This was referenced Sep 1, 2026
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.
Manifest:
host_permissions; added "scripting" for the popup's injection
sources, so the remote-sli.de/cdnjs/jquery/google-analytics entries are
gone and the policy is the MV3 default
Background page -> service worker (background.js):
worker ($.extend -> Object.assign) since it needs a DOM
createImageBitmap and scales it on an OffscreenCanvas, then serialises
through FileReader. Output is unchanged: a 40%-scale PNG payload with
the data URL header stripped
tab the controller actually runs in) and falls back to the active tab
leaving the caller waiting on a response that never comes
Popup (index.js):
{code: ...}, so remote_slide is handed over with func/args, and the
injections are chained so pageController.js only runs once jQuery and
socket.io are in place
stored controlledTab id instead of a non-existent .id on that number
Content scripts:
injector.js and preziInjector.js
Other:
for the bundled inject/controller submodule, which still targets MV2. It
is injected just before pageController.js and can be removed once that
submodule is migrated
allow; removed along with its script tag
Co-Authored-By: Claude noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01TwwH67Z38ZV9GaWAtPZhfP