[MV2] 针对 WebExtensions API Changes (Firefox 149-152) 做修正#1448
Open
cyfung1031 wants to merge 1 commit into
Open
[MV2] 针对 WebExtensions API Changes (Firefox 149-152) 做修正#1448cyfung1031 wants to merge 1 commit into
cyfung1031 wants to merge 1 commit into
Conversation
Collaborator
Author
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.

Checklist / 检查清单
Description / 描述
<iframe>的烂代码<script>烂代码content_security_policy缺失的'unsafe-eval'sandbox="allow-scripts"为sandbox="allow-same-origin allow-scripts"注1: CSP 保留 blob, 因为我们还是会用
URL.createObjectURL(...). 保留以避免出问题。注2: options.html 那个
sandbox.html的去留由 CodFrm 决定Screenshots / 截图
WebExtensions API Changes (Firefox 149-152)
https://blog.mozilla.org/addons/2026/04/23/webextensions-api-changes-firefox-149-152/
moz-extension:documentstabs.executeScript,tabs.insertCSS,tabs.removeCSS,scripting.executeScript,scripting.insertCSS,scripting.removeCSS<script>tags, module imports, static scripts, or aruntime.onMessagelistener in the extension document to trigger behavior. (Mozilla Blog)moz-extension:documentsmanifest.jsonsandbox support discussed as replacement path for string executionsandboxkeycodeoption because a normalfilescript was not enough, Mozilla planned sandbox support so string-based execution can happen in unprivileged extension documents. (Bugzilla)action.openPopup()andbrowserAction.openPopup()no longer require a user gesture on desktopaction.openPopup,browserAction.openPopupextensions.openPopupWithoutUserGesture.enabled; enabling by default required checking cross-browser behavior and adding rejection cases. (Bugzilla)openPopup({ windowId })requires the target window to be focusedaction.openPopup,browserAction.openPopup,windows.updatewindows.update(windowId, { focused: true }). (MDN Web Docs)tabIdparameter form foraction.isEnabled()/browserAction.isEnabled()action.isEnabled(tabId),browserAction.isEnabled(tabId)action.enable(tabId)/action.disable(tabId)style. (Bugzilla)tabs.Tab.splitViewId,tabs.query,tabs.onUpdated,tabs.move,tabs.removesplitViewIdis read-only. (MDN Web Docs)splitViewIdtotabs.Tabandtabs.onUpdated; WECG API proposal was referenced. (Bugzilla)structuredClonebehavior changed for content scriptsstructuredClonein content scriptsthisrealm; content scripts now get their ownstructuredCloneshadowingwindow.structuredClone. (MDN Web Docs)pageActionSVG icons disabled/removedpage_action.default_iconSVGs; dark theme renderingprefers-color-schemeor usetheme_iconswhere appropriate. (Mozilla Blog)tabs.move()can swap tabs inside a split viewtabs.movetabs.move()can unsplit when split-view tabs are explicitly listed aparttabs.movetabs.movecase already has clear expected behavior. (Bugzilla)navigator.credentials.create(),navigator.credentials.get(), manifesthost_permissionsclientDataJSON.originmoz-extension://<hash>for WebAuthn extension-origin validation. (MDN Web Docs)chrome-extension://<id>and Firefox’s deterministicmoz-extension://<sha256-hash>form. (MDN Web Docs)moz-extension://uuiddocument URLs. (MDN Web Docs)importcalls failing to import CSSimport/ CSS modules in add-on contexttabs.group()andtabs.ungroup()correctly add/remove split view when one split-view tab is includedtabs.group,tabs.ungrouptabs.move()correctly moves a split view to the right inside tab groupstabs.movefile://*/,<all_urls>, content scripts onfile:URLs,extension.isAllowedFileSchemeAccess()<all_urls>orfile://*/is no longer enough; users must enable “Allow access to file URLs.” This applies to existing extensions too. (Bugzilla)