webpack-ext-reloader icon indicating copy to clipboard operation
webpack-ext-reloader copied to clipboard

fix: support mv3 background script

Open iantanwx opened this issue 2 years ago • 10 comments

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]

iantanwx avatar Mar 18 '22 04:03 iantanwx

Hi! Any movement on getting this PR in master? Thanks :D

ralphschindler avatar Jun 23 '22 16:06 ralphschindler

Hey! I'm looking for this as well, can it be merged?

bashbaugh avatar Jun 28 '22 16:06 bashbaugh

Hi @rushilsrivastava @rubenspgcavalcante could you help to review this PR?

lucasrmendonca avatar Jun 29 '22 02:06 lucasrmendonca

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.

just-jeb avatar Jun 30 '22 10:06 just-jeb

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.

that's really odd -- it works in our fork. could you try that and see?

iantanwx avatar Jul 06 '22 10:07 iantanwx

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 with Uncaught TypeError: Cannot read properties of null (reading 'runtime') because browser is null.

Any reproducible examples?

rushilsrivastava avatar Jul 06 '22 11:07 rushilsrivastava

@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.

just-jeb avatar Jul 07 '22 12:07 just-jeb

@iantanwx Were you able to reproduce this?

rushilsrivastava avatar Aug 12 '22 22:08 rushilsrivastava

@rushilsrivastava Sorry I have been really busy, have not rebased upstream yet. Will try to do this in the coming week. Apologies!

iantanwx avatar Aug 14 '22 04:08 iantanwx

Hi @iantanwx any news on this?

lucasrmendonca avatar Oct 02 '22 13:10 lucasrmendonca

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 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

sherifmayika avatar Nov 27 '22 04:11 sherifmayika

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

reorx avatar Feb 23 '23 16:02 reorx

Perfect, I'll take a look at the PR @reorx!

rushilsrivastava avatar Feb 23 '23 20:02 rushilsrivastava

Closing in favor of #386.

vialoh avatar Sep 28 '23 14:09 vialoh