Use of background page now needed in Chrome extension for all cross-origin requests.

This commit is contained in:
ccd0 2018-09-18 00:57:18 -07:00
parent 680fc3384f
commit 5afb980a38

View File

@ -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]