Skip to content
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

Chrome extension security: Code generation from strings disallowed #158

Closed
g2010a opened this issue Jul 21, 2012 · 7 comments
Closed

Chrome extension security: Code generation from strings disallowed #158

g2010a opened this issue Jul 21, 2012 · 7 comments
Milestone

Comments

@g2010a
Copy link

g2010a commented Jul 21, 2012

Google will be disallowing eval and other 'dangerous' methods in extensions ( see https://code.google.com/chrome/extensions/contentSecurityPolicy.html ). This means that extensions relying on Miso are already breaking. Can Dataset be implemented in compliance with Google's requirements?

@g2010a
Copy link
Author

g2010a commented Jul 22, 2012

... hm. It seems to be the dependency on lodash.js that triggers the alert. Installing the unminified package and replacing lodash with underscore works.

@alexgraul
Copy link
Member

Thats...an unexpected issue. Will investigate.

@jdalton
Copy link

jdalton commented Jul 23, 2012

The issue you are seeing is because of lodash's use of _.template, which uses Function(...), to build methods optimized for the current environment. For Chrome extensions you can use the mobile build lodash mobile which has methods inlined, not compiled. That should avoid the issue.

For more info on builds check out http://lodash.com/#custom-builds.

@g2010a
Copy link
Author

g2010a commented Jul 23, 2012

Thanks, I'll check out the lodash mobile build.

@jdalton
Copy link

jdalton commented Jul 24, 2012

Related to issue: lodash/issues/54.

@alexgraul
Copy link
Member

I think the answer here is just to use the mobile build if you're doing an extension, I'm not sure there's much point us offering a separate build and we can't switch wholesale without breaking IE support. Another one for the wiki a la #170

@jdalton
Copy link

jdalton commented Sep 2, 2012

Cool, I aliased the lodash mobile build as lodash csp too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants