Tim Pillard
unread,Aug 29, 2025, 12:36:28 PM (7 days ago) Aug 29Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, Oliver Dunk, Chromium Extensions, Tim Pillard
Hi Oliver,
Thank you for the quick reply.
This use of importScripts is in the critical initialization path of our service worker.
> Could you clarify what this means?
I
mean this import is necessary for our extension to function, and an
exception throwing at this level will prevent further initialization of
our service worker script.
> It needs to run almost immediately, and definitely before any async code
in the service worker. Usually putting the import at the top-level of
your file is the safest approach. Some nesting can be ok, but it is easy
to get wrong.
It's in a synchronous code path
but technically not at the top of the file, rather pretty far down,
there are dozens of function calls, uncluding async code before it.
Do
you recommend I try to move this import as high as possible to heir on
the safe side? Or should I use a oninstall event listener?