Load service worker entry point from nested folder with MV3

224 views
Skip to first unread message

Clément Vidal

unread,
Jan 26, 2021, 11:42:23 AM1/26/21
to Chromium Extensions
Hello, 

Is there some kind of limitations with manifest v3 extension that would prevent me to use a file stored inside a nested folder as a service worker entry point ?

Exemple:

"background": {
"service_worker": "Webpack/Background.js"

When doing so, chrome output the following error: `Service worker registration failed`

If i use the exact same file, but this time stored at the root of the extension bundle, everything works fine.

Do you have any clues ?

Thanks,

Clément

PhistucK

unread,
Jan 26, 2021, 3:17:30 PM1/26/21
to Clément Vidal, Chromium Extensions
I guess it is based on the same principle of service workers. They control the path (and sub-paths) they reside in.
It seems to be working as intended to me.

PhistucK


--
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/12c1906c-c742-4167-a028-b727365795d1n%40chromium.org.

Clément Vidal

unread,
Jan 26, 2021, 4:50:43 PM1/26/21
to Chromium Extensions
Thanks Phistuck,

Do you know were i can find more info about that specific behavior ?


--
You received this message because you are subscribed to a topic in the Google Groups "Chromium Extensions" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-extensions/eOosUOIh7cE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-extens...@chromium.org.

PhistucK

unread,
Jan 26, 2021, 5:26:38 PM1/26/21
to Clément Vidal, Chromium Extensions
This is what I could find after a short search -
"The max scope for a service worker is the location of the worker."

PhistucK


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/CADT4s5%3D%2BtjgdFRbdAS3re3_qxFNRmBAADd1gGskvVFV0pFQ%3D9A%40mail.gmail.com.

Simeon Vincent

unread,
Jan 26, 2021, 6:11:35 PM1/26/21
to Chromium Extensions, PhistucK, Chromium Extensions, cle...@privowny.com
PhistucK is on the money. The service worker file must live in the extension's root directory. I opened a bug for this (crbug.com/1136582) hoping it would be an easy fix, but it appears to be a more complicated issue than I originally thought.

Cheers,

Simeon - @dotproto
Chrome Extensions DevRel

Clément Vidal

unread,
Jan 27, 2021, 3:19:55 AM1/27/21
to Chromium Extensions, Simeon Vincent, PhistucK, Chromium Extensions, Clément Vidal
Thanks for your quick answer guys, i'll take a look at this service worker scope notion.

Cheers

PhistucK

unread,
Jan 28, 2021, 4:13:59 AM1/28/21
to Clément Vidal, Chromium Extensions, Simeon Vincent
I believe the scope property can only narrow the scope, not widen it.

PhistucK

Reply all
Reply to author
Forward
0 new messages