I am new to XMLHttpRequest and JavaScript and all this stuff.
I made a gopro WiFi app to control gopro cameras with XMLHttpRequest, but it does not work with the packaged Chrome app, it works with the HTML file in Chrome.
Source
Any ideas?

有帮助吗?

解决方案

Your problem is using inline scripting (e.g. <button onclick="command('bacpac','PW','%00')">)

This is disallowed by Chrome's Content Security Policy for apps/extensions, and you cannot override this.

You'll have to purge your index.html of all inline code and add handlers (or indeed, buttons) from a script. Example in the Chrome docs.

其他提示

It appears that you're not using XHR (XMLHttpRequest) (at least I can't find any usage of it in your code), instead you're trying to dynamically create tags with remote url's as src. Loading remote scripts in tags is not allowed in the apps CSP.

So the way to fix this, is to actually use XHR.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top