Does Emberjs work with Chrome extension?

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

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

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'"

1 Like

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

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

It works well with chrome extension.

I made a simple chrome extension called youtube.md

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

3 Likes

So far I have not seen risky issues.

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.

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: Building Chrome Extensions With EmberJS - YouTube

1 Like

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