mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 14:57:32 +09:00
22 lines
414 B
JavaScript
22 lines
414 B
JavaScript
"use strict";
|
|
|
|
this.EXPORTED_SYMBOLS = ["webrequest_test"];
|
|
|
|
Components.utils.importGlobalProperties(["fetch", "XMLHttpRequest"]);
|
|
|
|
this.webrequest_test = {
|
|
testFetch(url) {
|
|
return fetch(url);
|
|
},
|
|
|
|
testXHR(url) {
|
|
return new Promise(resolve => {
|
|
let xhr = new XMLHttpRequest();
|
|
xhr.open("HEAD", url);
|
|
xhr.onload = () => {
|
|
resolve();
|
|
};
|
|
xhr.send();
|
|
});
|
|
},
|
|
};
|