Fall back to ordinary AJAX request if userscript manager lacks GM_xmlhttpRequest.

This commit is contained in:
ccd0 2018-09-17 20:50:00 -07:00
parent 78dd2a9639
commit 1f7846502d

View File

@ -91,6 +91,10 @@ CrossOrigin =
if /^https:\/\//.test(url) or location.protocol is 'http:'
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]
cb responses[url]
return