webpack-ext-reloader
webpack-ext-reloader copied to clipboard
fix: support mv3 background script
Fixes background worker issues in manifest version 3. See https://github.com/rubenspgcavalcante/webpack-extension-reloader/pull/139.
Checklist
- [x] I ran the linting and formatting tools (ESLint and Prettier)
- [x] I added addittional tests if adding new features
Closes #[ISSUE_NUMBER]
Hi! Any movement on getting this PR in master? Thanks :D
Hey! I'm looking for this as well, can it be merged?
Hi @rushilsrivastava @rubenspgcavalcante could you help to review this PR?
I've tried both this patch and #220, none of them seem to be working. Getting Service worked registration failed
with Uncaught TypeError: Cannot read properties of null (reading 'runtime')
because browser
is null
.
I've tried both this patch and #220, none of them seem to be working. Getting
Service worked registration failed
withUncaught TypeError: Cannot read properties of null (reading 'runtime')
becausebrowser
isnull
.
that's really odd -- it works in our fork. could you try that and see?
Sorry for the hiatus - happy to help get this merged in.
I've tried both this patch and #220, none of them seem to be working. Getting
Service worked registration failed
withUncaught TypeError: Cannot read properties of null (reading 'runtime')
becausebrowser
isnull
.
Any reproducible examples?
@iantanwx @rushilsrivastava are your forks up to date with master? What I did essentially is taking these patches and applying them on a latest local version of webpack-ext-reloader
.
There is an example here, in order to get the error you'll have to use your patched version of webpack-ext-reloader
and uncomment the plugin usage in dev config.
After that just run yarn watch
.
@iantanwx Were you able to reproduce this?
@rushilsrivastava Sorry I have been really busy, have not rebased upstream yet. Will try to do this in the coming week. Apologies!
Hi @iantanwx any news on this?
I've tried both this patch and #220, none of them seem to be working. Getting
Service worked registration failed
withUncaught TypeError: Cannot read properties of null (reading 'runtime')
becausebrowser
isnull
.
I can give you a clue to how to solve this issue. browser.runtime should be replaced with chrome.runtime in manifest 3. for example: open: webpack-ext-reloader.js from '/node_modules/webpack-ext-reloader/dist' replace "browser.extension", "browser.runtime", with "chrome.extension" and "chrome.runtime" . Origin of this error is from 'webextension-polyfill'. I think 'webextension-polyfill' lack support for manifest 3.
it is better to remove 'webextension-polyfill' https://stackoverflow.com/questions/68488195/browser-extension-manifest-v3-with-webextension-polyfill-does-not-allow-browser
I adapted @sherifmayika 's advice and finally made my fork work. Anyone with the same problem can try to use my fork at https://github.com/reorx/webpack-ext-reloader
Perfect, I'll take a look at the PR @reorx!
Closing in favor of #386.