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

@ -13,7 +13,7 @@
}
const {checkerWrapper, setGetterProperties, getStatusByFlag} = require("./modifiedAPIFunctions");
const logging = require("./logging");
const extension = require("./extension");
const navigator = require("./navigator");
let cookieStoreId = false;
@ -27,16 +27,7 @@
};
function getCookieStoreId(){
while (cookieStoreId === false){
logging.message("Starting synchronous request to wait for cookie store id.");
try {
let xhr = new XMLHttpRequest();
xhr.open("GET", "https://[::]", false);
xhr.send();
xhr = null;
}
catch (error){
logging.verbose("Error in XHR:", error);
}
extension.waitSync("to wait for cookie store id");
}
return cookieStoreId;
}