Skip to content

How can metamask engine execute code downloaded from npnjs.org ? #1861

Locked Answered by rekmarks
javaspeak asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @javaspeak! You are correct that the content security policy (CSP) of Chrome extensions generally forbid the use of eval() (i.e. "direct eval") or constructing interpreters. However, we do not have any "special arrangements" with extension stores. It is not against guidelines or policy for an extension to interact with third parties such as websites (via the browser) or any entity you can reach using fetch(). We just interact with our third parties in a different way.

Per our architecture, snaps are executed inside of an iframe, which are not subject to the CSP of the extension itself. Moreover, this iframe is "locked down" using SES / hardened JavaScript, as detailed in our snap execu…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
1 reply
@javaspeak
Comment options

Answer selected by rekmarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants