mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Remove duplicated code
This commit is contained in:
parent
64b60c834a
commit
6fbb9339a1
6 changed files with 59 additions and 96 deletions
|
@ -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);
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue