guptahanu / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 1 forks source link

Allow cross domain origin access to using http header #427

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to use the hosted version of jQuery in a user-script, but since 
Google Chrome runs user-scripts in a sandbox the only way I am able to 
include jQuery is by copying/pasting the minified version or loading and 
evaling it using an xmlhttpRequest. Using xmlhttpRequest seems like a better 
way to go since it will make the scripts smaller and often already be in the 
user's cache, but Google Chrome also restricts xmlhttpRequests using the 
same-origin policy, so I would need to either host it on the same domain as 
the website (not feasible for user-scripts) or use a CDN that includes the 
'Access-Control-Allow-Origin: *' header defined by the W3C Cross-Origin 
Resource Sharing (http://www.w3.org/TR/access-control/). Is there any way to 
change the http://ajax.googleapis.com CDN so that it will set this header and 
allow cross-origin access to jQuery and other ajax libraries?

Original issue reported on code.google.com by greg.b...@gmail.com on 13 Apr 2010 at 1:50

GoogleCodeExporter commented 8 years ago
More details here: 

http://stackoverflow.com/questions/2626367/any-hosted-versions-of-jquery-that-ha
ve-the-
access-control-allow-origin-head

Original comment by greg.b...@gmail.com on 14 Apr 2010 at 11:14

GoogleCodeExporter commented 8 years ago
Not sending CORS headers also now means any script error details sent to 
`window.onerror` will be scrubbed and contain no useful information.

See http://stackoverflow.com/a/14165776/201952

Original comment by josh3...@gmail.com on 4 Jan 2013 at 10:25