Enable crossOriginIsolated and use of SharedArrayBuffer for Extension pages
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: mozilla+bugzilla, Unassigned)
References
(Depends on 2 open bugs, )
Details
Trying to use SharedArrayBuffer
on an arbitrary extension page results in Uncaught ReferenceError: SharedArrayBuffer is not defined
. Also crossOriginIsolated
says false
. I'd expect extension pages to be secure contexts.
According to MDN it'd need to set to Cross-Origin Headers accordingly, but that doesn't work for extension pages.
Maybe Bug 1575625 is related
Comment 1•4 years ago
|
||
That's because extension pages aren't cross-origin-isolated. All extensions currently run in the same process.
Comment 3•2 years ago
|
||
I'm re-opening this bug, to let it serve as the issue to track enabling SharedArrayBuffer more broadly. It is currently only enabled to privileged extensions (bug 1674383).
Chrome allows extensions to opt in to SharedArrayBuffer
when their manifest.json specifies cross_origin_embedder_policy
and cross_origin_opener_policy
.
- Chrome's implementation bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1199491
- Chrome's design doc: https://docs.google.com/document/d/1c6SX3fsp7x1BlzpCPvYSKPtjjT56W4DpoOKPSXmLllo/edit
- Documentation for COEP: https://developer.chrome.com/docs/extensions/mv3/manifest/cross_origin_embedder_policy/
- Documentation for COOP: https://developer.chrome.com/docs/extensions/mv3/manifest/cross_origin_opener_policy/
Comment 4•2 years ago
|
||
Hope you don't mind me re-writing the summary to sound like the new feature work it would be.
Updated•2 years ago
|
Comment 5•2 years ago
|
||
Reading the footnote to the google doc that Daniel linked, it says "Extension processes are isolated now. See https://bugs.chromium.org/p/chromium/issues/detail?id=1209417". I saw a lot of activity from 2021 but am unclear on the current blocker (though confess I am just an extension developer, not a Mozilla expert, so an explanation geared toward a non-expert would be welcome). Is it a prioritization question or does it still bear the same complexity described as of 2021?
It would be awesome to reach parity with Chrome's ability to host SQLite via OPFS in the browser. Our non-profit is building a suite of apps meant to help individuals to own, control, analyze, and use their own data without having to rely on trusting third-party servers (since end-users don't tend to run servers of their own). SQLite in the browser via OPFS would allow powerful local-first, private-by-design application models. Thank you!
Comment 6•2 years ago
|
||
(In reply to Vince Scafaria from comment #5)
Reading the footnote to the google doc that Daniel linked, it says "Extension processes are isolated now. See https://bugs.chromium.org/p/chromium/issues/detail?id=1209417".
Dan just linked the tickets and doc I mentioned in comment 3. All of that information is specific to Chromium, but the reasoning and API design is relevant to other browsers as well.
I saw a lot of activity from 2021 but am unclear on the current blocker (though confess I am just an extension developer, not a Mozilla expert, so an explanation geared toward a non-expert would be welcome). Is it a prioritization question or does it still bear the same complexity described as of 2021?
I don't know what you are referring to. In any case, the curent status in Firefox is:
- in bug 1674383, we offered SharedArrayBuffer to privileged extensions.
- Extensions in Firefox run in a separate process.
- All extensions share the same process.
- To support
crossOriginIsolated
andSharedArrayBuffer
, we would have to support multiple processes, at least for extensions that opt in to COEP/COOP.
Comment 11•1 year ago
|
||
Hi, just checking back to better understand status/timing for this to allow use of Sqlite3/OPFS in a Firefox extension. Any estimate available? Thanks!
Comment 13•5 months ago
|
||
Any updates? There is an extension that is on chrome that i really want to use on firefox but the dev says this needs to be implemented first.
https://sites.google.com/view/history-trends-unlimited/faq#h.p_919uTSRmqHZ_
Comment 14•3 months ago
|
||
Hi guys any updates on this? Given Google's decision to phase out MV2 extensions. I plan to move back to Firefox.
However, there's one crucial extension, History Trends Unlimited, that I rely on heavily and unfortunately, it doesn't have a Firefox version due to this bug.
I would appreciate it alot if someone steps in!
Thanks for reading!
7. Will you make a version of the extension for Firefox?
Yes, once it is possible to do so. Keep an eye on Firefox issue 1673477. Once it is fixed, I should be able to port this extension to Firefox.
And please see FAQ #11: The extension is closed source, so forks are not allowed.
https://sites.google.com/view/history-trends-unlimited/faq?authuser=0#h.p_919uTSRmqHZ_
Comment 15•24 days ago
|
||
I also wanted to ask, if there are any news regarding this feature. Thanks already!
Description
•