1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-05-29 09:28:06 +02:00

Added more logging to frame script.

This commit is contained in:
kkapsner 2017-07-18 16:18:36 +02:00
parent 3c47eaf97f
commit c8b451cf2f

View File

@ -98,6 +98,7 @@
{subject: window},
{check, checkStack, ask: askWrapper, notify, prefs}
);
log("prepare to intercept (i)frames.");
[window.HTMLIFrameElement, window.HTMLFrameElement].forEach(function(constructor){
var oldContentWindowGetter = constructor.prototype.__lookupGetter__("contentWindow");
@ -142,13 +143,16 @@
enabled = false;
}
if (data.hasOwnProperty("canvasBlocker-sendNotifications") && data["canvasBlocker-sendNotifications"] === tabId){
log("sending notifications:", notifications);
browser.runtime.sendMessage({
sender: tabId,
"canvasBlocker-notifications": notifications
});
log("notifications sent");
}
});
log("load settings");
browser.storage.local.get().then(function(data){
Object.keys(data).forEach(function(key){
log("loaded setting:", key, ":", data[key]);
@ -160,6 +164,7 @@
browser.storage.onChanged.addListener(function(change, area){
if (area === "local"){
Object.keys(change).forEach(function(key){
log("setting changed:", key, ":", change[key].newValue);
settings[key] = change[key].newValue;
});
}