Closed Bug 2020773 Opened 1 month ago Closed 1 month ago

userScripts in MV2 sandbox does not have a fix for the structuredClone regression

Categories

(WebExtensions :: General, defect, P1)

defect

Tracking

(firefox148 unaffected, firefox149 fixed, firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox148 --- unaffected
firefox149 --- fixed
firefox150 --- fixed

People

(Reporter: robwu, Assigned: rpl)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(2 files)

bug 2017797 fixed the regression for structuredClone in content scripts and the sandbox of user scripts registered through the MV3 userScripts API.

But the fix was not applied to the sandbox of userScripts API from MV2.

For completeness and future reference, here is an overview of Cu.Sandbox instances in extensions that interact with content:

Examples of unit tests that trigger the creation of such sandboxes and verify the execution within can be seen in the patch to bug 1912587 at https://phabricator.services.mozilla.com/D219142

  • test_Document_parseHTML_and_parseHTMLUnsafe tests content scripts
  • test_Document_parseHTML_in_mv2_userscript_sandbox tests MV2 user script sandbox.
  • test_Document_parseHTML_in_mv3_userscript_sandbox tests MV3 user script sandbox.

The original regression was introduced in Firefox 149 by bug 2013389, setting status flags accordingly.

P1 because we want to get the fix in the same release as the other fix (uplift to beta).

The number of extensions using the MV2 user scripts API is relatively low (especially in comparison to content scripts), but nevertheless for sanity the behaviors should be identical.

Assignee: nobody → lgreco
Whiteboard: [addons-jira]
Severity: -- → S4
Priority: -- → P1
Blocks: 2022941
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch

The patch landed in nightly and beta is affected.
:rpl, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(lgreco)
Attachment #9552655 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes regression from bug 2013389 and bug 2017797 affecting extensions using MV2 userScripts API. Not fixing can break user scripts run through the MV2 userScripts extension API that rely on structuredClone.
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Fix is obvious and restores the original behavior of version 148 (before the regression was introduced). This only affects users of the MV2 userScripts extension API.
  • String changes made/needed?: No
  • Is Android affected?: yes
Flags: needinfo?(lgreco)
Attachment #9552655 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: