-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
service worker and self.addEventListener() #131
Comments
@bugficks are you able to run the script using webpack in isolation? In the ScriptsPlugin the background scripts are added in the entry configuration, I'm not sure it's possible to run earlier than that. Here's the code that implements it. We can definitely add a patch if needed. It's not possible to hook in the internal webpack config without a hack yet, but happy to patch a fix to make it work if that's the case |
It seems to work using webpack in isolation. For testing I have used chrome-extension-webpack. |
Possibly related to an upstream dep https://github.com/awesome-webextension/webpack-target-webextension, got to take a deeper look |
this seems to be an issue how webpack resolves/imports modules. |
Thanks, this needs a deeper look but currently focused on the next release. Not sure how to fix this one at the moment |
I am trying to reliably detect service worker restarts.
chrome.runtime.onXXX
does not work if you e. g. start/stop throughchrome://serviceworker-internals/
.So I've tried to add at top of my background.ts :
Unfortunately this is results in:
background.ts:2 Event handler of 'activate' event must be added on the initial evaluation of worker script.
background.ts:7 Event handler of 'install' event must be added on the initial evaluation of worker script.
How can I achieve that ?
Is there any way to hook in webpack build config?
The text was updated successfully, but these errors were encountered: