Repository navigation
Conversation
Add a Safari build target and work around the extension APIs Safari does not implement, so the existing extension can run as a Safari Web Extension. - manifest.config.ts: omit Chrome-only keys (`action.default_area`, `options_ui.open_in_tab`) and the unsupported `management` permission when building for Safari - package.json / Makefile: add `build:safari` and `convert:safari` scripts and a `make safari` target that wraps the build into an Xcode project via `safari-web-extension-converter` (script/convert-safari.sh, which also validates the referenced icons and supports a signing team) - guard `runtime.onUpdateAvailable` and the `management` API, which are absent in Safari, and make dynamic content-script registration tolerant - handle the `safari-web-extension://` scheme in the hosted stylesheet check - README: document building, running, signing and installing in Safari
The settings-sync broadcast runs on every completed tab load and can target a tab that has since closed or that does not run a content script, which Safari surfaces as "Invalid call to tabs.sendMessage(). Tab not found.". Add an error callback that consumes `runtime.lastError` so these expected failures are silently ignored (same for the update-ready broadcast).
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.
Proposed changes
Adds a Safari build target and works around the extension APIs Safari doesn't implement, so the extension can run as a Safari Web Extension.
Tested on Safari 27: extension loads on Twitch, emotes render, settings/options work. Chrome/Firefox manifests are unchanged (OUT_DIR=mv3 verified identical). Chrome (MV3) and Firefox (MV2) manifests are unchanged — verified against yarn build:prod for both.
Types of changes
What types of changes does your code introduce to 7TV?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.