-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use @chainsafe/as-sha256 in a chrome extension #312
Comments
As per the manifest docs the {
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
}
} Could you try that? If it does not work, Would be very helpful if you spin up a github repo with required and minimum extension setup to reproduce this issue. |
I got an error when trying that and I using the package inside of the background worker anyways. |
Would you setup some dummy repo with the extension setup you are trying, that will be helpful to debug the issue and test few things there. |
@nazarhussain Thanks, that works as well! I tried adding I'll still have to discuss with my team if we want to add such a directive; it may be okay as a workaround for us. |
@nazarhussain there should be an ability to plug-in a different sha256 implementation, such as noble-hashes. They aren't much slower - the speed is pretty huge. |
Wouldn't it possible to just require the wasm through a .wasm file rather than unsafe eval it through new Module()? |
Please see this #313 |
The wasm is loaded using new Module() instead of required. This cannot be supported in a manifest 3 chrome extension since it requires wasm-unsafe-eval in the CSP and this is disallowed by chrome. It turns out the latest version of
@ethereumjs/util
can no longer be used in a browser extension due to this. Not sure what the right thing is to do.Expected behavior
Should work normally
Steps to Reproduce
Build webextension and require latest versions of
@ethereumjs/util
using webpackScreenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: