Skip to content

Hand the session to the Firefox extension too - #11

Open
InventivetalentDev wants to merge 1 commit into
masterfrom
claude/zealous-meitner-fm8fqa
Open

InventivetalentDev wants to merge 1 commit into
masterfrom
claude/zealous-meitner-fm8fqa

Conversation

@InventivetalentDev

Copy link
Copy Markdown
Member

Website side of Firefox support for the extension (RemoteSlide/RemoteSlide-Chrome#5).

Problem

Firefox doesn't let web pages message an extension: it has no externally_connectable (bug 1319168), so chrome.runtime is undefined here. As a result:

  • the ping threw, so the download links stayed up;
  • the session never reached the extension;
  • the ?sessionOnly tab the extension opens never closed.

Changes

  • $scope.extension.send() keeps using chrome.runtime.sendMessage() where Chrome exposes it. Otherwise it posts the message to this window, where the extension's siteBridge.js content script relays it and posts the answer back.
  • The ?sessionOnly tab now closes once the extension has answered, because the bridge needs to finish before the tab goes away. It also closes after 900 ms at the latest. Extension versions up to 1.2.0 never answer the session message, so without that fallback, Chrome users still on one would keep the tab open.
  • PROTOCOL.md lists extension_firefox among the injector names.

static/inject/controller is deliberately not bumped to RemoteSlide/RemoteSlide-Controller#3: that fix only matters to the extension, not the bookmarklet.

Safe to deploy first

Merging deploys the site (deploy.yml runs on every push to master). The new site therefore goes live before the extension update reaches anyone, and it works with the extension currently in the Chrome Web Store. Tested against a local wrangler dev, with remote-sli.de resolved to it:

Extension detected Session stored ?sessionOnly tab closes
Chromium 141, extension from master (1.2.0) ✅ ✅ ✅ (via the fallback)
Chromium 141, extension from RemoteSlide/RemoteSlide-Chrome#5 ✅ ✅ ✅
Firefox 158, extension from RemoteSlide/RemoteSlide-Chrome#5 ✅ ✅ ✅
Firefox ESR 140, extension from RemoteSlide/RemoteSlide-Chrome#5 ✅ ✅ ✅

As a control, the current master site with the new extension fails all three checks in Firefox.

npm run typecheck and npm test (17 tests) pass locally.

Still to do once the add-on is listed on AMO: a Firefox download link next to the Chrome Web Store badge.


Generated by Claude Code

Firefox doesn't let web pages message an extension (no externally_connectable,
Mozilla bug 1319168), so chrome.runtime is undefined here. The ping threw,
the download links stayed up, the session never reached the extension, and
the ?sessionOnly tab the extension opens never closed.

$scope.extension.send() keeps using chrome.runtime.sendMessage() where
Chrome exposes it. Otherwise it posts the message to this window, where
the extension's siteBridge.js content script (RemoteSlide/RemoteSlide-Chrome,
same branch) relays it and posts the answer back. The ?sessionOnly tab now
closes once the extension has answered, which the bridge needs before the
tab goes away, or after a second at the latest: extension versions up to
1.2.0 never answer the session message, so Chrome users still on one
would otherwise keep the tab.

Checked in Chromium 141 with both the current and the new extension, and in
Firefox 158 and ESR 140 with the new one: extension detected, session
stored, ?sessionOnly tab closed.

Adds extension_firefox to the injector names in PROTOCOL.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P3g3vcYRESg89oZuTf7eP5

This branch has not been deployed

No deployments
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.

2 participants