diff --git a/lib/frame.js b/lib/frame.js index 11fd61d..9b4dc84 100644 --- a/lib/frame.js +++ b/lib/frame.js @@ -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); + }); }()); \ No newline at end of file