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

Only force setting loading when necessary

May help for #160.
This commit is contained in:
kkapsner 2017-12-04 00:26:26 +01:00
parent ba8f35a9a8
commit ce7dc1b422
4 changed files with 103 additions and 23 deletions

View file

@ -5,7 +5,7 @@
"use strict";
const settings = require("./settings");
const {intercept} = require("./intercept.js");
const {preIntercept: intercept} = require("./intercept.js");
const {ask} = require("./askForPermission.js");
const lists = require("./lists.js");
const {check: originalCheck, checkStack: originalCheckStack} = require("./check.js");
@ -163,22 +163,5 @@
}
});
// need to wait for the settings to arrive!
while (settings.isStillDefault){
logging.message("Starting synchronous request to wait for settings.");
try {
let xhr = new XMLHttpRequest();
xhr.open("GET", "https://[::]", false);
xhr.send();
xhr = null;
}
catch (e){
logging.verbose("Error in XHR:", e);
}
logging.message("settings still default?", settings.isStillDefault);
}
settings.onloaded(function(){
interceptWindow(window);
});
interceptWindow(window);
}());