Fall back to ordinary AJAX request if userscript manager lacks GM_xmlhttpRequest.
This commit is contained in:
parent
78dd2a9639
commit
1f7846502d
@ -91,6 +91,10 @@ CrossOrigin =
|
|||||||
if /^https:\/\//.test(url) or location.protocol is 'http:'
|
if /^https:\/\//.test(url) or location.protocol is 'http:'
|
||||||
return $.cache url, (-> cb @response), responseType: 'json'
|
return $.cache url, (-> cb @response), responseType: 'json'
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<% if (type === 'userscript') { %>
|
||||||
|
unless GM?.xmlHttpRequest? or GM_xmlhttpRequest?
|
||||||
|
return $.cache url, (-> cb @response), responseType: 'json'
|
||||||
|
<% } %>
|
||||||
if responses[url]
|
if responses[url]
|
||||||
cb responses[url]
|
cb responses[url]
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user