Is your feature request related to a problem? Please describe.
If I'm not mistaken magick-wasm can't be used in a MV3 (Manifest Version 3) extension, at least on Chrome.
If you try to use it, it's gonna give an error like this.
Uncaught (in promise) EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*".
I believe it gives that error because of this and this. Function is an unsafe expression according to here.
What I understand is it needs 'unsafe-eval' in content_security_policy.extension_pages, but it can't have that in MV3.
https://developer.chrome.com/docs/extensions/reference/manifest/content-security-policy
The extension_pages policy cannot be relaxed beyond this minimum value. In other words, you cannot add other script sources to directives, such as adding 'unsafe-eval' to script-src. If you add a disallowed source to your extension's policy, Chrome will throw an error like this at install time:
'content_security_policy.extension_pages': Insecure CSP value "'unsafe-eval'" in directive 'script-src'.;
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy#examples
Manifest V3 does not allow 'unsafe-eval' in script-src.
I've prepared some examples for both MV2 and MV3. They are designed to work as expected in the current up to date Chrome. I didn't check the API's for minimum version of Chrome. MV2 ones might require ExtensionManifestV2Availability or equilevent. They go step by step.
- An empty extension
- Tries to use magick-wasm
- Adds
wasm-unsafe-eval
- Adds
unsafe-eval
In MV2, it works fine at step 4. I think this proves I do nothing wrong in MV3. That's just the way it is.
Describe the solution you'd like
Implementation of the relevant functions in an alternative way.
Describe alternatives you've considered
No response
Additional context
No response
Is your feature request related to a problem? Please describe.
If I'm not mistaken magick-wasm can't be used in a MV3 (Manifest Version 3) extension, at least on Chrome.
If you try to use it, it's gonna give an error like this.
I believe it gives that error because of this and this.
Functionis an unsafe expression according to here.What I understand is it needs
'unsafe-eval'incontent_security_policy.extension_pages, but it can't have that in MV3.https://developer.chrome.com/docs/extensions/reference/manifest/content-security-policy
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy#examples
I've prepared some examples for both MV2 and MV3. They are designed to work as expected in the current up to date Chrome. I didn't check the API's for minimum version of Chrome. MV2 ones might require ExtensionManifestV2Availability or equilevent. They go step by step.
wasm-unsafe-evalunsafe-evalIn MV2, it works fine at step 4. I think this proves I do nothing wrong in MV3. That's just the way it is.
Describe the solution you'd like
Implementation of the relevant functions in an alternative way.
Describe alternatives you've considered
No response
Additional context
No response