Repository navigation
Support Firefox - #5
Open
InventivetalentDev wants to merge 2 commits into
Open
InventivetalentDev wants to merge 2 commits into
InventivetalentDev wants to merge 2 commits into
Conversation
Firefox runs the existing MV3 extension with a few additions to the shared manifest: - browser_specific_settings.gecko: the add-on ID (mandatory for MV3 on AMO), strict_min_version 140 (the first release with the built-in data consent prompt; ESR 140), and data_collection_permissions declaring websiteContent, since screenshots of the presented tab go to the server (AMO rejects new add-ons without this key). - background.scripts next to service_worker: Firefox has no background service workers and runs the scripts as an event page instead. Chrome ignores background.scripts from 121 on and refused the manifest before that, hence minimum_chrome_version 121. In the event page sessionGrabber.js comes from that list, as importScripts() only exists in the worker. - The popup reports the host as extension_firefox in Firefox, so the connection info tells the two browsers apart. Bumps the controller for the fix that lets scripting.executeScript() resolve in Firefox, without which the overlay and laser pointer never loaded. Checked end to end against a local copy of the site, in Firefox 158 and ESR 140 and, for regressions, in Chromium 141: background start, controller injection, host join, key presses, overlay, laser dot, badge, screenshots and the popup. One known gap: for an MV3 add-on, Firefox 140-151 never counts the granted <all_urls> host permission in the check captureVisibleTab() makes (changed in 152; seen working in ESR 153 and 158). There, screenshots rely on the activeTab grant from clicking the toolbar button, which is how control is started anyway. The grant lasts until the tab loads a new document, which also removes the controller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P3g3vcYRESg89oZuTf7eP5
Firefox doesn't implement externally_connectable, so remote-sli.de cannot reach the extension with chrome.runtime.sendMessage() there (Mozilla bug 1319168), and the popup never got a session. util/siteBridge.js, a content script on remote-sli.de, now relays what the site posts to its own window to the background and posts the answer back. The site falls back to that channel when chrome.runtime isn't exposed (RemoteSlide/remote-sli.de, same branch). Only messages from the page's own window are relayed, and the background only takes them from remote-sli.de tabs, the same origin externally_connectable allows. Both channels end up in handleSiteMessage(), which now always answers, so the site can close the ?sessionOnly tab once the extension has the session. sessionGrabber.js becomes the grabSession() it calls. Sets the Firefox add-on ID to remoteslide@inventivetalent.org. Checked against the local site with remote-sli.de pointed at it, in Firefox 158 and ESR 140 (bridge) and Chromium 141 (externally_connectable): ping/pong, the stored session, the ?sessionOnly tab closing itself, and no answer on other sites. The unchanged site fails the same check in Firefox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P3g3vcYRESg89oZuTf7eP5
This was referenced Oct 18, 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.
Makes the existing extension run in Firefox as well. It stays one codebase with one manifest for both browsers: each browser ignores the keys meant for the other.
Depends on RemoteSlide/RemoteSlide-Controller#3 (the submodule points at its commit
7f11f75) and, for sessions in Firefox, on RemoteSlide/remote-sli.de#11.Changes
Manifest
browser_specific_settings.gecko:remoteslide@inventivetalent.org. This becomes permanent once the add-on is submitted to AMO.strict_min_version140: the first release with Firefox's built-in data-consent prompt, and an ESR.data_collection_permissions: websiteContent, because screenshots of the presented tab go to the server. AMO rejects new add-ons without this key.background.scriptsnext toservice_worker. Firefox has no background service workers and runs the scripts as an event page. Chrome ignoresbackground.scriptsfrom 121 on but refused such a manifest before that, sominimum_chrome_versiongoes from 102 to 121.*://*.remote-sli.de/*for the session bridge (below).Background
importScripts()only exists in the service worker. In Firefox,sessionGrabber.jscomes frombackground.scriptsinstead.handleSiteMessage(), whether they arrive directly (Chrome,externally_connectable) or through the bridge (Firefox). It always answers now, so the site can close its?sessionOnlytab once the extension has the session.sessionGrabber.jsbecomes thegrabSession()it calls.Session bridge (
util/siteBridge.js)Firefox doesn't implement
externally_connectable(bug 1319168), so remote-sli.de can't reach the extension withchrome.runtime.sendMessage()there.externally_connectableallows.Popup
Reports the host as
extension_firefoxin Firefox, so the connection info tells the browsers apart.Testing
Each browser was driven end to end against a local copy of the site, with remote-sli.de resolved to it:
?sessionOnlytab closesexternally_connectableweb-ext lint: 0 errors (2 before this change). The remaining warnings:service_workeris ignored by Firefox (intended).innerHTMLuse inutil/preziVarBridge.js, plus the bundled AngularJS.Known gaps
<all_urls>host permission out of the checkcaptureVisibleTab()makes. This happens right after install and also after a restart. Firefox changed this in 152, and I saw it working in ESR 153 and 158. On 140–151, screenshots rely on theactiveTabgrant from clicking the toolbar button, which is how control is started anyway. That grant lasts until the tab loads a new document, which also removes the controller. Hash andpushStatenavigation keep it. Raisingstrict_min_versionto 152 would close the gap at the cost of ESR 140.util/preziInjector.jsadds a<script src="moz-extension://…">to the page, which the page's CSP might block in Firefox.Merging
Merge RemoteSlide/RemoteSlide-Controller#3 with a merge commit first. A squash merge plus branch deletion would leave
7f11f75unreachable and break this submodule on fresh clones. If it does get squashed, repointinject/controllerat the squashed commit before merging this.🤖 Generated with Claude Code
https://claude.ai/code/session_01P3g3vcYRESg89oZuTf7eP5