'allow-same-origin' flag?

1,889 views
Skip to first unread message

Bruce Davidson

unread,
Dec 17, 2021, 12:30:47 AM12/17/21
to Chromium Extensions

I'm trying to create an extension that uses the WebAudio api. My app works when in a separate web page, but when I try to run it as an extension, I get this error:

Uncaught SecurityError: Failed to read the 'serviceWorker' property from 'Navigator': Service worker is disabled because the context is sandboxed and lacks the 'allow-same-origin' flag.

Where/how do I set this 'allow-same-origin' flag? Is there a complete list of all the keys/flags in the manifest that references this?

Simeon Vincent

unread,
Jan 5, 2022, 8:47:51 PM1/5/22
to Bruce Davidson, Chromium Extensions
I'm afraid that I don't quite follow your question. Could you share a demo extension that illustrates the issue you're having?

Simeon - @dotproto
Chrome Extensions DevRel


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/d7343c9b-7d59-48de-b770-178f2607b91en%40chromium.org.

hrg...@gmail.com

unread,
Jan 7, 2022, 10:37:23 AM1/7/22
to Chromium Extensions, Simeon Vincent, Chromium Extensions, darkoverl...@gmail.com
A sandboxed context is created when you do this:
<iframe src="..." sandbox></iframe>

If that's what you are doing, then you can add the "allow-same-origin" flag to the sandbox attribute, like this:
<iframe src="..." sandbox="allow-same-origin"></iframe> 
 
Reply all
Reply to author
Forward
0 new messages