fix(safari): prevent context loss by calling scripting methods natively - #79
Closed
StifflyAnyhow wants to merge 1 commit into
Closed
fix(safari): prevent context loss by calling scripting methods natively#79StifflyAnyhow wants to merge 1 commit into
StifflyAnyhow wants to merge 1 commit into
Conversation
Safari requires `this` to be bound when calling `chrome.scripting` methods. Storing `registerContentScripts` as a bare reference loses the `this` context, causing it to fail on Safari. Instead of tearing off the methods, we now use booleans for feature detection and call the methods directly on their parent objects to naturally preserve the context.
StifflyAnyhow
force-pushed
the
fix/safari-scripting-bind
branch
from
May 12, 2026 05:31
38f126c to
038221a
Compare
Owner
|
Closing because #76 will eventually do the same |
Merged
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.
Uses
globalThis.chrome.scripting.registerContentScriptsandglobalThis.browser.contentScripts.registerdirectly instead of cached references to preventthiscontext loss in Safari.Unblocks refined-github/refined-github#9441 by re-enabling dynamic content script registration on Safari, which was previously broken because the cached
chrome.scriptingreference lost itsthisbinding.