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]
|
delete callbacks[url]
|
||||||
|
|
||||||
(url, cb, bypassCache) ->
|
(url, cb, bypassCache) ->
|
||||||
<% if (type === 'crx') { %>
|
|
||||||
plainAJAX = (/^https:\/\//.test(url) or location.protocol is 'http:')
|
|
||||||
<% } %>
|
|
||||||
<% if (type === 'userscript') { %>
|
<% if (type === 'userscript') { %>
|
||||||
plainAJAX = not (GM?.xmlHttpRequest? or GM_xmlhttpRequest?)
|
unless GM?.xmlHttpRequest? or GM_xmlhttpRequest?
|
||||||
<% } %>
|
|
||||||
if plainAJAX
|
|
||||||
if bypassCache
|
if bypassCache
|
||||||
$.cleanCache (url2) -> url2 is url
|
$.cleanCache (url2) -> url2 is url
|
||||||
if (req = $.cache url, cb, responseType: 'json')
|
if (req = $.cache url, cb, responseType: 'json')
|
||||||
@ -115,6 +110,7 @@ CrossOrigin =
|
|||||||
else
|
else
|
||||||
cb.call {}
|
cb.call {}
|
||||||
return
|
return
|
||||||
|
<% } %>
|
||||||
|
|
||||||
if bypassCache
|
if bypassCache
|
||||||
delete results[url]
|
delete results[url]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user