Questions tagged [sharedarraybuffer]

`SharedArrayBuffer` is a JavaScript object that provides for sharing memory across threads.

SharedArrayBuffer (MDN, spec) is a JavaScript object that provides for sharing memory across threads, such as web worker threads in browsers, or worker threads in Node.js.

72 questions
3
votes
3 answers

Setting Cross-origin-Embedder-Policy and Cross-origin-Opener-Policy headers in nodejs

I've been developping a website using express(NodeJS) for the backend and React for the frontend. I've come accross the issue where my application won't work on Firefox due to this error "ReferenceError: SharedArrayBuffer is not defined". After…
3
votes
0 answers

Is it possible to broadcast a SharedArrayBuffer to Web Workers via the Broadcast Channel API?

The Broadcast Channel API seems like an alternative to postMessage or the Channel Messaging API (aka MessageChannel.) I've used both successfully in recent versions of Google Chrome to send Shared Array Buffers; however, I am having trouble sending…
2
votes
2 answers

How to enable sharedArrayBuffer in chrome without cross-origin isolation

I have this experiment which I only run on my local machine: I load an external webpage from, for example https://example.com and the with puppeteer I inject a javascript file which is served from http://localhost:5000. So far there are no issues.…
2
votes
1 answer

Using service worker to enable COOP/COEP headers : security concerns?

I'm unable to access my server to enable COOP and COEP headers, but I was able to add them via service worker by using the following script https://github.com/gzuidhof/coi-serviceworker, which registers a service worker that has the headers…
2
votes
1 answer

Firebase hosting : headers not taking effect (COEP and COOP http headers)

I want to set the headers Cross-Origin-Embedder-Policy: require-corp and Cross-Origin-Opener-Policy: same-origin so I can enable SharedArrayBuffer, so I can use https://github.com/ffmpegwasm/ffmpeg.wasm I have set these in firebase.json, however…
ultraGentle
  • 5,084
  • 1
  • 19
  • 45
2
votes
1 answer

Pyodide: ReferenceError: SharedArrayBuffer is not defined

I am developing my final year project. Developing a browser-based IDE. I am using Pyodide for compiling. It was working fine before, but when I tried to run the project now, I have encountered an error about SHaredArrayBuffer(). I do not know what…
2
votes
0 answers

How to enable cross origin isolation? (the specifics)

I am hosting a website using 1and1 (ionos), and it is serving a HTML page with imported CSS and JS. I am trying to figure out how to enable cross origin isolation, but all I can find is that we need to enable certain response headers:…
2
votes
3 answers

Where to set headers for SharedArrayBuffer in React?

I'm running a website created with create-react-app on localhost on Windows10. When I try to use ffmpeg in my website, I get the error "SharedArrayBuffer is not defined" in Firefox. To fix this I seen everywhere that I have to add COOP and COEP…
2
votes
1 answer

Google oAuth2 signin with cross origin isolation

I have a web app that relies on SharedArrayBuffer. I turned on cross-origin isolation on my website because google chrome will require it by the end of the month. However, doing so breaks Google oAuth2 login. I tried to import the auth script with…
Nicolas
  • 2,191
  • 3
  • 29
  • 49
1
vote
1 answer

Enabling cross-origin isolation on the apache2 web server

My system is Ubuntu and i use the apache2 web server. I need SharedArrayBuffer in my site. But when I call my page I get the error: "Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined"
Spiri
  • 331
  • 2
  • 9
1
vote
0 answers

Is it possible to use Firebase auth with cross origin isolation without using Firebase Hosting?

I've added a feature to my web app that requires using SharedArrayBuffer. To access shared SharedArrayBuffer my site needs to be cross origin isolated. I have added the required headers Cross-Origin-Opener-Policy:…
1
vote
1 answer

Cannot get SharedArrayBuffer to work in android webview, although it works in both chrome and firefox on both android and desktops

I am trying to run mupdf built as web assembly in a webview on Android. I have set the response headers correctly as far as I know, and this is illustrated by the fact that the web page using the web assembly works fine on desktop browsers and…
Benson Bear
  • 11
  • 1
  • 3
1
vote
1 answer

Unhandled JS Exception: Can't find variable: SharedArrayBuffer

I'm starting my react-native project using expo in the iOS version and getting this obscure error which is blocking development progress. I've only started to see this error after trying to setup the supabase.js package and trying to setup the…
tscafie
  • 61
  • 8
1
vote
1 answer

304 ERR_BLOCKED_BY_RESPONSE for web worker file after enabling same-origin CORS to allow SharedArrayBuffer

I'm looking to do some multithreading for my web application to improve performance and I've stumbled upon a head-scratcher. I'm currently developing on localhost (vite server) on Chrome. Basically I have spawned a web worker. Then I created a…
1
vote
1 answer

Enable Shared Array Buffer in Cross-Domain

I am facing a problem, SAB(SharedArrayBuffer) does not work in cross-domain environment. Target IFrame's source is on another domain, I added aliases to hosts file(Windows OS). I am sending SAB through postMessage to IFrame, but it simply does not…