You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A reload now triggers infinite reloading in Chrome #3468
$ google-chrome --version
Google Chrome 138.0.7204.100
$ ./node_modules/.bin/web-ext run --target chromium -s src/
Running web extension from /home/alexei/Projects/privacybadger/src
The extension will reload if any source file changes
Press R to reload (and Ctrl-C to quit)
Reload works with web-ext 8.6.0 and --arg="--disable-features=DisableLoadExtensionCommandLineSwitch" and manually "keeping" and re-enabling the reload manager extension. However the manual keep/re-enable is pretty annoying if you want to frequently relaunch for whatever reason. Also, DisableLoadExtensionCommandLineSwitch and manual re-enabling will both stop working at some point.
I tried running your command but it failed at first, with error: Error: Cannot install extension because it uses an unsupported manifest version.
I tried again, now with: web-ext run -t chromium -s ~/privacybadger/src/ --arg=--enable-features=AllowLegacyMV2Extensions --verbose
I pressed R.
Result: the extension reloaded once.
One potential cause of the infinite reload is if Chrome modifies the directory where the extension is loading from. I know that it does, for example, if it is a theme extension or an extension using declarativeNetRequest. For example, a simple extension with one static ruleset (even if disabled!) is compiled and written to _metadata/generated_indexed_rulesets/_ruleset1.
If you are getting tripped by auto-reload triggered by source changes, you could disable auto reloading by passing the --no-reload flag, and manually reload via chrome://extensions/ . Or if you do like the auto-reloading aspect but don't want to watch all directories, choose a specific file to watch by passing the --watch-file or --watch-files options to web-ext run
Thank you for the workarounds! However, if it's indeed DNR, I don't think web-ext users with DNR extensions should individually have to discover and work around this problem.
It is indeed DNR. If I check out your mv3-chrome branch and add --verbose, I see that web-ext detects changes to the file path I mentioned before and reloads Chrome as a result. This reload happens in all web-ext versions, not just the latest one. E.g. with web-ext@8.6.0 and the --verbose flags, I see that it detects the _metadata/ change I mentioned above and reloads the extension once.
With web-ext 8.6.0 the infinite-reload issue did not happen, because it did not re-install the extension (or even reload like what would happen if you pressed the Reload extension icon in chrome://extensions/ ), but it disabled and re-enabled the extension. With the latest web-ext version, the mechanism to reload extensions is the same as (re)installing an extension, which appears to trigger the full (DNR) initialization.
I'm supportive of ignoring the _metadata directory by default.
P.S. Ideally, Chrome should not change the source directory where it is loading from.
With the latest web-ext version, the mechanism to reload extensions is the same as (re)installing an extension, which appears to trigger the full (DNR) initialization.
Does this mean something about the behavior of reloaded Chrome DNR extensions changed in the latest web-ext version? Does the new web-ext do reloading more correctly in some way (for DNR anyway)? Or is it just that more stuff happens on reload with latest web-ext but there is no difference in behavior?
I discussed this issue with my team, and we are willing to unconditionally ignore the _metadata/ directory (at least when the target is chromium).
With the latest web-ext version, the mechanism to reload extensions is the same as (re)installing an extension, which appears to trigger the full (DNR) initialization.
Does this mean something about the behavior of reloaded Chrome DNR extensions changed in the latest web-ext version? Does the new web-ext do reloading more correctly in some way (for DNR anyway)?
Yes. A "reload" is now equivalent to issuing a request to install an extension in Chrome. Previously, it was disable and re-enable, for the lack of a better way to do so. If you'd like to learn more about the motivation and differences, see #3388 and #3434.
If you'd like to learn more about the motivation and differences
Thanks, I looked at the linked issues, but I don't see an explanation of the differences between reloading with CDP and "reloading" via disable/enable w/ helper extension. If there are differences, it would be good to clearly document them somewhere, such as in the release notes or even just here in this issue.
Activity
ghostwords commentedon Jul 11, 2025
Reload works with web-ext 8.6.0 and
--arg="--disable-features=DisableLoadExtensionCommandLineSwitch"and manually "keeping" and re-enabling the reload manager extension. However the manual keep/re-enable is pretty annoying if you want to frequently relaunch for whatever reason. Also,DisableLoadExtensionCommandLineSwitchand manual re-enabling will both stop working at some point.Rob--W commentedon Jul 11, 2025
I am unable to reproduce your problem. What I did in an attempt to reproduce is as follows:
Error: Cannot install extension because it uses an unsupported manifest version.web-ext run -t chromium -s ~/privacybadger/src/ --arg=--enable-features=AllowLegacyMV2Extensions --verboseResult: the extension reloaded once.
One potential cause of the infinite reload is if Chrome modifies the directory where the extension is loading from. I know that it does, for example, if it is a theme extension or an extension using declarativeNetRequest. For example, a simple extension with one static ruleset (even if disabled!) is compiled and written to
_metadata/generated_indexed_rulesets/_ruleset1.If you are getting tripped by auto-reload triggered by source changes, you could disable auto reloading by passing the
--no-reloadflag, and manually reload viachrome://extensions/. Or if you do like the auto-reloading aspect but don't want to watch all directories, choose a specific file to watch by passing the--watch-fileor--watch-filesoptions toweb-ext runghostwords commentedon Jul 11, 2025
Try reproducing with MV3 Privacy Badger: https://github.com/EFForg/privacybadger/tree/mv3-chrome
ghostwords commentedon Jul 11, 2025
Thank you for the workarounds! However, if it's indeed DNR, I don't think
web-extusers with DNR extensions should individually have to discover and work around this problem.Rob--W commentedon Jul 11, 2025
It is indeed DNR. If I check out your mv3-chrome branch and add
--verbose, I see thatweb-extdetects changes to the file path I mentioned before and reloads Chrome as a result. This reload happens in all web-ext versions, not just the latest one. E.g. with web-ext@8.6.0 and the--verboseflags, I see that it detects the_metadata/change I mentioned above and reloads the extension once.With web-ext 8.6.0 the infinite-reload issue did not happen, because it did not re-install the extension (or even reload like what would happen if you pressed the Reload extension icon in chrome://extensions/ ), but it disabled and re-enabled the extension. With the latest web-ext version, the mechanism to reload extensions is the same as (re)installing an extension, which appears to trigger the full (DNR) initialization.
I'm supportive of ignoring the
_metadatadirectory by default.P.S. Ideally, Chrome should not change the source directory where it is loading from.
ghostwords commentedon Jul 11, 2025
Yeah agreed on all points (I don't like the
_metadatadirectory either!), and thank you for the super quick response!!Rob--W commentedon Jul 11, 2025
Btw, another option is to pass the
--watch-ignored=/full/path/to/src/_metadataoption (do not add a/).The parameter will end up being passed to the watchpack library at
web-ext/src/watcher.js
Line 31 in 5ce29de
The option accepts a glob; paths if given must be absolute.
ghostwords commentedon Jul 11, 2025
Does this mean something about the behavior of reloaded Chrome DNR extensions changed in the latest web-ext version? Does the new web-ext do reloading more correctly in some way (for DNR anyway)? Or is it just that more stuff happens on reload with latest web-ext but there is no difference in behavior?
Rob--W commentedon Jul 17, 2025
I discussed this issue with my team, and we are willing to unconditionally ignore the
_metadata/directory (at least when the target ischromium).Yes. A "reload" is now equivalent to issuing a request to install an extension in Chrome. Previously, it was disable and re-enable, for the lack of a better way to do so. If you'd like to learn more about the motivation and differences, see #3388 and #3434.
ghostwords commentedon Jul 17, 2025
Thanks, I looked at the linked issues, but I don't see an explanation of the differences between reloading with CDP and "reloading" via disable/enable w/ helper extension. If there are differences, it would be good to clearly document them somewhere, such as in the release notes or even just here in this issue.
ghostwords commentedon Jul 18, 2025
For anyone who finds this issue, it sounds like the main (only?) difference is that the manifest wasn't getting reloaded and now it is (#2277).