Does Emberjs work with Chrome extension?


#1

Does Emberjs work with Chrome extension?

I am trying to use jquery, handlebar, and emberjs in Chrome and It’s giving me this error.

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' chrome-extension-resource:".
 handlebars-1.0.0.js:1457

Uncaught 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' chrome-extension-resource:".

Error looks like this: http://i.imgur.com/3spiCdh.png


#2

I am using Handlebars 1.3.0 in Chrome Extension and it works normally, may be you can try to update Handlebars.


#3

The problem was with the manifest.json file in chrome extensions.

I needed to add

"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"


#4

I am starting an extension project today. Hope it works~


#5

We use ember in our extensions with a few glitches around how popups are handled in chrome vs firefox.


#6

It works well with chrome extension.

I made a simple chrome extension called youtube.md


#7

As others have said it should work fine, the Ember Inspector Chrome Extension is built using Ember…


#8

So far I have not seen risky issues.


#9

It sems content_security_policy doesn’t work in packaged apps, after getting Uncaught EvalError and adding the CSP change I get: 'content_security_policy' is only allowed for extensions and legacy packaged apps, but this is a packaged app.


#10

You might want to check out this project: https://github.com/j-mcnally/ember-cli-chrome

The author gave a presentation at the Chicago Ember meetup, and it looked pretty cool. Here’s the video: https://www.youtube.com/watch?v=NtkpDL2yKGo


#11

brilliant … that’s it … I was facing the same issue and adding this one line made it all very simple