hybridgroup / cylon-example-chrome

Cylon.JS example, running in a Chrome app.
http://cylonjs.com
4 stars 1 forks source link

Enhancing cylon to allow live update of code #2

Open vivek1729 opened 7 years ago

vivek1729 commented 7 years ago

I am developing a chrome App based on Cylonjs. I love the project and wanted to augment it so that we can dynamically send new code and it get flashed to the serial device. The example app here refers to a static browser.js file which is generated by browserify combining script.js and other node modules required. I figured that the browser.js file can be built dynmically as contents of script.js are already included in that file. So, that is the whole motivation of my project as this could evolve into a full fledged arduino web editor chrome App. I am able to dynamically build browser.js file but Chrome doesn't let me inject javascript dynamically into the DOM and I get the following error:

Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-Mugizlz7AFKJ2hm6UA9ySY/31cKCVhLaEX9/QYpJIsk='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

_ @ basket_chrome.js:250 (anonymous) @ reducers.js:37

I would really love some ideas on how do I solve this issue so that we can have a Cylonjs based 'Thing editor' of sorts as a chrome app.