Open Bug 1673477 Opened 4 years ago Updated 24 days ago

Enable crossOriginIsolated and use of SharedArrayBuffer for Extension pages

Categories

(WebExtensions :: General, enhancement, P3)

Firefox 83
enhancement

Tracking

(Not tracked)

REOPENED

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

That's because extension pages aren't cross-origin-isolated. All extensions currently run in the same process.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
Duplicate of this bug: 1823260

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.

Status: RESOLVED → REOPENED
Component: Untriaged → General
Ever confirmed: true
Resolution: INVALID → ---
See Also: → 1674383

Hope you don't mind me re-writing the summary to sound like the new feature work it would be.

Type: defect → enhancement
Summary: Extension pages don't allow using `SharedArrayBuffer` because they are not considered `crossOriginIsolated` → Enable crossOriginIsolated and use of SharedArrayBuffer for Extension pages
Severity: -- → N/A
Priority: -- → P3

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!

Flags: needinfo?(rob)

(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 and SharedArrayBuffer, we would have to support multiple processes, at least for extensions that opt in to COEP/COOP.
Flags: needinfo?(rob)
Depends on: 1827085

This will prevent me from migrating my extension from IDB to Sqlite3/OPFS.

Duplicate of this bug: 1843652
Duplicate of this bug: 1843651
Duplicate of this bug: 1843653
Depends on: 1750654

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!

Any news on this? Waiting 2 years for implementation of this feature :(

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_

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_

I also wanted to ask, if there are any news regarding this feature. Thanks already!

You need to log in before you can comment on or make changes to this bug.