webext-dynamic-content-scripts icon indicating copy to clipboard operation
webext-dynamic-content-scripts copied to clipboard

v10 doesn't fully support complex conditions in MV2 Chrome

Open fregante opened this issue 2 years ago • 0 comments
trafficstars

There's a very rare situation that is no longer covered by webext-dynamic-content-scripts. This is a long list of conditions that have to appear at the same time for the bug to appear:

  • You're on Chrome
  • Your manifest_version is 2
  • Your manifest has multiple objects inside content_scripts
  • Your content_scripts mentions the same file twice (for example to be injected onto multiple domains, via manifest)
  • Your content_scripts have one of run_at, exclude_matches, all_frames
  • Your other content_scripts do not have the same exact property

If this is happening, you should stay on v9 of this module until you upgrade to Manifest v3.

Here's an example extension affected by this limitation:

{
	"manifest_version": 2,
	"content_scripts": [
		{
			"all_frames": true, // Present here, missing from the next one
			"matches": ["https://example.com/*"],
			"js": ["content.js"],
		},
		{
			"matches": ["https://www.example.org/*"],
			"js": ["content.js"],
		}
	]
}

fregante avatar May 16 '23 18:05 fregante