This commit is contained in:
Dmitrii Selivanov committed 2021-11-21 23:08:48 +03:00
commit 62759efb04
1 file changed
+10 -1
@@ -28,7 +28,16 @@ function doXHR(opts) {
return GM.xmlHttpRequest(opts);
}
console.error('Unable to detect UserScript plugin.');
console.warn('Unable to detect UserScript plugin, falling back to native XHR.');
const xhr = new XMLHttpRequest();
xhr.open(opts.method, opts.url, true);
xhr.onload = () => opts.onload({
response: JSON.parse(xhr.responseText),
});
xhr.onerror = err => console.error('XHR Failed', err);
xhr.send();
}
function getButtons() {