Auto-reloads for offscreen pages/scripts #1060
Replies: 2 comments 9 replies
-
|
Maybe it is possible to have the hmr in service-worker trigger a reload on offscreen - like a hook of I'm trying to setup a working playground but it does not work for me. https://github.com/Toumash/crxjs-offscreen-test Not seeing the console.log and chrome://inspect/#other - nothing |
Beta Was this translation helpful? Give feedback.
-
Yeah, either HMR or auto-reload work automatically in the popup (we have no content scripts) and background. However, I'm curious why the offscreen changes were getting picked up at all by auto-reload, given that they aren't even imported from the background script (but only mentioned in offscreen document creation by public path) 🤔. Maybe it has something to do with the The other thing I'm curious about now is whether React might handle auto-refresh differently than Vue. However, since both use Vite, that doesn't seem super likely? But perhaps the React Vite plugin is helping out? |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to support automatically reloading the extension upon changes to offscreen pages/scripts? While any changes in scripts referenced via manifest
backgroundwill cause an extension refresh, any changes to scripts related to a created offscreen document are not automatically applied. Instead, these require a manualbuildprocess, which appears to break HMR for the rest of the extension (for content scripts, etc), requiring the Vite server to be restarted.A large part of our extension's (audio/video recording) is handled in the background, and this means that updating these workflows require a lengthy process: make small changes, run and wait for
build, reload extension, test changes, etc. Meanwhile, any smaller UI changes (in content scripts) will also require an entirebuildprocess, since the HMR appears to break after runningbuild(must restart Vite server to enable again).Is there any way to support automatically reloading the extension upon changes to created offscreen pages/scripts? Any way to indicate to Vite that these changes should be picked up by HMR?
manifest.config.tsbackground/service-worker.tsbackground/offscreen/index.htmlbackground/offscreen/offscreen.tsP.S. Example output from change to
background/service-worker, indicating that Vite is indeed picking up those changes. However, a similar to change tobackground/offscreen/offscreen.tsdoes not get picked up by Vite!Beta Was this translation helpful? Give feedback.
All reactions