MCPcopy
hub / github.com/hoothin/UserScripts / corsEnabled

Function corsEnabled

Picviewer CE+/Picviewer CE+.user.js:138–148  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

136 }
137
138 function corsEnabled(url) {
139 var xhr = new XMLHttpRequest(); // use sync to avoid popup blocker
140
141 xhr.open('HEAD', url, false);
142
143 try {
144 xhr.send();
145 } catch (e) {}
146
147 return xhr.status >= 200 && xhr.status <= 299;
148 } // `a.click()` doesn't work for all browsers (#465)
149
150
151 function click(node) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected