Closed Bug 1599579 Opened 5 years ago Closed 4 years ago

[meta] Make all moz-extension: loads COOP loads, and place them in separate BrowsingContextGroups

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla80
Fission Milestone M6a
Tracking Status
firefox-esr68 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix
firefox80 --- fixed

People

(Reporter: kmag, Assigned: nika)

References

(Regressed 1 open bug)

Details

(Keywords: meta, Whiteboard: [fission:m5c])

Attachments

(7 files)

There are probably a lot of reasons to force extension pages to use COOP, but the most pressing is that all privileged extension pages can directly access any other privileged pages from the same extension. The problem with this is that we also have an invariant that any two content pages which can directly access each other must be in the same BrowsingContextGroup, which in the case of extension pages, does not actually hold.

The only way to fix the problem is to force the BrowsingContext for any extension page that we create into the same BrowsingContextGroup as any other pages that it can access. And in the cases where the page isn't the first thing loaded into a FrameLoader, the only way to do that is to completely replace any existing BrowsingContext with a new one, in the appropriate group. This is essentially the same behavior required for COOP, just with the added complexity of also controlling the group of that BrowsingContext.

Priority: -- → P2

Moving P2 M5 bugs to M5b milestone

Fission Milestone: M5 → M5b

M5c

Morphing this bug into a meta bug because Nika has WIP patches for part of this bug. kmag will file new blocking bugs for the other parts.

Fission Milestone: M5b → M5
Keywords: meta
Summary: Make all moz-extension: loads COOP loads, and place them in a single BrowsingContextGroup → [meta] Make all moz-extension: loads COOP loads, and place them in a single BrowsingContextGroup
Whiteboard: [fission:m5c]

Nika recommends unassigning kmag for now. We should fix this bug for M5 Dogfooding, but it's not the most urgent bug.

Assignee: kmaglione+bmo → nobody
Assignee: nobody → kmaglione+bmo

Nika says 99% of this is implemented.
Affects non-Fission, too.
Every extension should have its own BrowsingContextGroup.

Fission Milestone: M5 → M5b
Summary: [meta] Make all moz-extension: loads COOP loads, and place them in a single BrowsingContextGroup → [meta] Make all moz-extension: loads COOP loads, and place them in separate BrowsingContextGroups

kmag says this bug doesn’t need to block Fission M5 Dogfooding because this bug affects non-Fission users, too.

Fission Milestone: M5b → M6a

kmag said Nika is taking over this one.

Assignee: kmaglione+bmo → nika
Status: NEW → ASSIGNED
Depends on: 1646817

The goal with this is to avoid having multiple booleans and other values
computed in arbitrary places and used around the method, and instead pre-compute
common shared information, and group each remoteType special-case together.

Hopefully, this should make it easier to extend the behaviour in
MaybeTriggerProcessSwitch in the future.

This is done by tracking a specific BrowsingContextGroup ID on the
WebExtensionPolicy in the parent process. Whenever a load is done with that
policy, the browsing context is replaced to ensure it is loaded in the correct
BrowsingContextGroup.

This patch also ensures that extension iframes are always loaded in the same
process as their embedder document, even if the frame was previously remote.

Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ebd2eb155da Part 1: Add the ability to specify a specific BrowsingContextGroup during process switch, r=kmag https://hg.mozilla.org/integration/autoland/rev/a4e7334f8ce6 Part 2: Reorganize RemoteType logic in MaybeTriggerProcessSwitch, r=mattwoodrow,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/085558fe56dc Part 3: Load toplevel extension frames into a per-extension BrowsingContextGroup, r=kmag https://hg.mozilla.org/integration/autoland/rev/c2828aec4caf Part 4: Expose BrowsingContextGroup.id to JS, r=kmag https://hg.mozilla.org/integration/autoland/rev/053229a30ef1 Part 5: Ensure all views have matching BrowsingContextGroup IDs in getViews test, r=kmag
Flags: needinfo?(nika)
Summary: [meta] Make all moz-extension: loads COOP loads, and place them in separate BrowsingContextGroups → Make all moz-extension: loads COOP loads, and place them in separate BrowsingContextGroups

This is done by reloading framescripts and re-attaching message listeners when
process switch events are fired.

Summary: Make all moz-extension: loads COOP loads, and place them in separate BrowsingContextGroups → [meta] Make all moz-extension: loads COOP loads, and place them in separate BrowsingContextGroups
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b4bdd8759433 Part 1: Add the ability to specify a specific BrowsingContextGroup during process switch, r=kmag https://hg.mozilla.org/integration/autoland/rev/14698ab42ee4 Part 2: Reorganize RemoteType logic in MaybeTriggerProcessSwitch, r=mattwoodrow,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/73f6c956fc30 Part 3: Load toplevel extension frames into a per-extension BrowsingContextGroup, r=kmag https://hg.mozilla.org/integration/autoland/rev/cfdd8d5973d4 Part 4: Expose BrowsingContextGroup.id to JS, r=kmag https://hg.mozilla.org/integration/autoland/rev/c5bc0ea42193 Part 5: Ensure all views have matching BrowsingContextGroup IDs in getViews test, r=kmag https://hg.mozilla.org/integration/autoland/rev/b767f26b10ed Part 6: Handle process switches in talos pageloader.js, r=mconley,perftest-reviewers,Bebe
Backout by abutkovits@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/99571b1367d3 Backed out 6 changesets for bc failures at test_chrome_ext_contentscript_data_uri.html.
Flags: needinfo?(nika)
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8ae775aac9f7 Part 1: Add the ability to specify a specific BrowsingContextGroup during process switch, r=kmag https://hg.mozilla.org/integration/autoland/rev/e6252187b0a8 Part 2: Reorganize RemoteType logic in MaybeTriggerProcessSwitch, r=mattwoodrow,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/871123e639a8 Part 3: Load toplevel extension frames into a per-extension BrowsingContextGroup, r=kmag https://hg.mozilla.org/integration/autoland/rev/4c1d7b36f035 Part 4: Expose BrowsingContextGroup.id to JS, r=kmag https://hg.mozilla.org/integration/autoland/rev/a89a0e4bb31e Part 5: Ensure all views have matching BrowsingContextGroup IDs in getViews test, r=kmag https://hg.mozilla.org/integration/autoland/rev/f817fd7a0a6d Part 6: Handle process switches in talos pageloader.js, r=mconley,perftest-reviewers,Bebe https://hg.mozilla.org/integration/autoland/rev/2e058695addc Part 7: Fix failing contentscript test, r=kmag
Blocks: 1649457
Regressions: 1651372
Regressions: 1651261

can we do something like a webextensions permission to exempt an extension so it doesn't break the urlbar focus on custom NTPs

See Also: → 1655898
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: