Use of background page now needed in Chrome extension for all cross-origin requests.
This commit is contained in:
parent
680fc3384f
commit
5afb980a38
@ -101,13 +101,8 @@ CrossOrigin =
|
||||
delete callbacks[url]
|
||||
|
||||
(url, cb, bypassCache) ->
|
||||
<% if (type === 'crx') { %>
|
||||
plainAJAX = (/^https:\/\//.test(url) or location.protocol is 'http:')
|
||||
<% } %>
|
||||
<% if (type === 'userscript') { %>
|
||||
plainAJAX = not (GM?.xmlHttpRequest? or GM_xmlhttpRequest?)
|
||||
<% } %>
|
||||
if plainAJAX
|
||||
unless GM?.xmlHttpRequest? or GM_xmlhttpRequest?
|
||||
if bypassCache
|
||||
$.cleanCache (url2) -> url2 is url
|
||||
if (req = $.cache url, cb, responseType: 'json')
|
||||
@ -115,6 +110,7 @@ CrossOrigin =
|
||||
else
|
||||
cb.call {}
|
||||
return
|
||||
<% } %>
|
||||
|
||||
if bypassCache
|
||||
delete results[url]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user