I have a chrome extension that displays UI from a web service as its own inside an iframe inside an extension page. I am injecting some content scripts into the remote UI using:
"content_scripts": [
{
"matches" : [ "https://mywebservice.com/frontend/*" ] ,
"js" : [ "frontend-page-contentscript.js" ],
"all_frames" : true
}
]
Which is allowed because of (also in manifest.json): [EDIT: This turns out NOT to be required to run content-scripts in the iframe – but removing it doesn’t make AJAX work the way I expect].
"sandbox" : {
"pages" : [
"cocoon_page_proxy.html"
]
}
However, when I make a trivial ajax call (not from the content script, from the iframe):
$.get('asdf',function success(data) { console.log("Success"); },
function error(xhr) { console.log("Error: "+xhr.responseText); });
I don’t get any response, it stalls out and gets a “0” for a status. This (in my experience) is usually due to a cross-origin permissions problem, but it shouldn’t be – it’s requesting another resource from the same server the main page came from.
Suggestions?
Sigh – it turns out to be a bug stemming from elsewhere in my extension, in webrequest redirect code.