1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Remove duplicated code

This commit is contained in:
kkapsner 2020-01-26 01:11:18 +01:00
parent 64b60c834a
commit 6fbb9339a1
6 changed files with 59 additions and 96 deletions

View file

@ -176,5 +176,18 @@
}
};
scope.waitSync = function waitSync(reason = "for no reason"){
logging.message(`Starting synchronous request ${reason}.`);
try {
let xhr = new XMLHttpRequest();
xhr.open("GET", "https://[::]", false);
xhr.send();
xhr = null;
}
catch (error){
logging.verbose("Error in XHR:", error);
}
};
Object.seal(scope);
}());