XMLHttpRequest does not work in a Chrome app
NickName:konraditurbe Ask DateTime:2014-04-01T04:29:03

XMLHttpRequest does not work in a Chrome app

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?

Copyright Notice:Content Author:「konraditurbe」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22771555/xmlhttprequest-does-not-work-in-a-chrome-app

Answers
Xan 2014-04-04T08:57:05

Your problem is using inline scripting (e.g. <button onclick=\"command('bacpac','PW','%00')\">)\n\nThis is disallowed by Chrome's Content Security Policy for apps/extensions, and you cannot override this.\n\nYou'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.",


More about “XMLHttpRequest does not work in a Chrome app” related questions

XMLHttpRequest does not work in a Chrome app

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 ...

Show Detail

XMLHttpRequest not work in my extension chrome

I'm trying to useXMLHttpRequest in a google chrome extension, but the results are not satisfactory, it does not work { "manifest_version": 2, "name": "TESTE", "description": &

Show Detail

local xmlhttprequest from sandboxed page in chrome packaged app

I have a packaged app that embeds a app-local page in an iframe (to embed libraries doing forbidden stuff). My sandboxed page wants to make an xmlhttprequest to a relative URL (so still in the same

Show Detail

How to detect XMLHttpRequest errors in a Chrome App

How do I detect XMLHttpRequest errors in Chrome App. For example I want to know when net::ERR_NAME_NOT_RESOLVED is being generated so I can output an error message to the user. XMLHttpRequest.o...

Show Detail

xmlhttpRequest error on google chrome

I have a method in javascript that does the folowing: var X = new XMLHttpRequest(); X.open('GET',U,false); X.setRequestHeader('Content-Type','text/html'); X.send('');

Show Detail

XMLHttpRequest not working with Chrome

I have this code, to simple update "cupom" from "0" to "1", but it isnt working with Chrome, with firefox it does work, any help/advice is welcome. var req; function val_impressao_js(cpf) { if(wi...

Show Detail

Chrome Extension with XMLHttpRequest slow at launch

At the moment I am developing a Google Chrome Extension in which I have to fetch data from a server. I am doing this with an XMLHttpRequest and all is going well, except for the fact when I launch ...

Show Detail

Chrome XMLHttpRequest reference

Is there any documentation for the current Chrome implementation of XMLHttpRequest similar to this: https://developer.mozilla.org/en/XMLHttpRequest I couldn't find anything on Chrome's dev site an...

Show Detail

XMLHttpRequest not working in Google Chrome Packaged Web App

I'm writing a packaged Chrome Web App and trying to parse external XML. It works when I download the XML file to my server, but does not work when I change the XML file to the location on the web....

Show Detail

XMLHTTPRequest loading local file in chrome extension

So the XMLHttpRequest shouldn't work for loading local files for websites. It would be a crazy security risk if a person could actually gain access to a user's file system via JavaScript. But for

Show Detail