문제

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