id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blocking,blockedby
12252,supporting $.getJSON for JSON-P services in CSP environment,godmar@…,,"Google Chromium has recently started enforcing a CSP on core extension code that forbids <script> loading from anywhere but from whitelisted https:// sources.  As a result, I need to sniff and use $.get or $.getJSON like so:


{{{
if (inCSPEnvironment that restricts <script> insertion) {
   $.get(url_nocallback, function (jsonText) { processJSON(JSON.parse(jsonText)) });
} else {
   $.getJSON(url_withcallback, processJSON);
}
}}}


It would be nice if I didn't have to, that is, if $.getJSON handled that for me so my $.getJSON code wouldn't break in a CSP environment in which <scripts> cannot be inserted (although cross-domain XHR is legal).

This is just an idea - a lot of frameworks/libraries are now being made compatible with CSP environments, so you'll probably be seeing increased use of jQuery there.  But of course, you could also leave that to the user (good arguments can be made for that).",enhancement,closed,low,None,ajax,1.8.0,patchwelcome,,jaubourg,,
