1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-01-03 10:31:54 +01:00

Wait for settings in the frame script

Fixes #147
This commit is contained in:
kkapsner 2017-11-14 01:04:20 +01:00
parent b3bb10d334
commit 41d9b7073f

View File

@ -141,10 +141,6 @@
return true;
}
settings.onloaded(function(){
interceptWindow(window);
});
message("register listener for messages from background script");
browser.runtime.onMessage.addListener(function(data){
if (data["canvasBlocker-unload"]){
@ -162,4 +158,17 @@
notice("notifications sent");
}
});
// need to wait for the settings to arrive!
while (settings.isStillDefault){
logging.message("Starting synchronous request to wait for settings.");
let xhr = new XMLHttpRequest();
xhr.open("GET", browser.extension.getURL("releaseNotes.txt"), false);
xhr.send();
logging.message("settings still default?", settings.isStillDefault);
}
settings.onloaded(function(){
interceptWindow(window);
});
}());