Index: include.preload.js |
=================================================================== |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -160,17 +160,17 @@ |
let mediatype = typeMap.get(element.localName); |
if (!mediatype) |
return; |
let urls = getURLsFromElement(element); |
if (urls.length == 0) |
return; |
- ext.backgroundPage.sendMessage( |
+ chrome.runtime.sendMessage( |
{ |
type: "filters.collapse", |
urls, |
mediatype, |
baseURL: document.location.href |
}, |
collapse => |
@@ -182,17 +182,17 @@ |
} |
); |
} |
function checkSitekey() |
{ |
let attr = document.documentElement.getAttribute("data-adblockkey"); |
if (attr) |
- ext.backgroundPage.sendMessage({type: "filters.addKey", token: attr}); |
+ chrome.runtime.sendMessage({type: "filters.addKey", token: attr}); |
} |
function ElementHidingTracer() |
{ |
this.selectors = []; |
this.changedNodes = []; |
this.timeout = null; |
this.observer = new MutationObserver(this.observe.bind(this)); |
@@ -243,17 +243,17 @@ |
break nodes; |
} |
} |
} |
} |
if (selectors.length > 0 || filters.length > 0) |
{ |
- ext.backgroundPage.sendMessage({ |
+ chrome.runtime.sendMessage({ |
type: "devtools.traceElemHide", |
selectors, filters |
}); |
} |
}, |
onTimeout() |
{ |
@@ -447,44 +447,44 @@ |
// the code below. See issue #5090. |
// Related Chrome and Firefox issues: |
// https://bugs.chromium.org/p/chromium/issues/detail?id=632009 |
// https://bugzilla.mozilla.org/show_bug.cgi?id=1310026 |
this.injectSelectors(selectors, filters); |
} |
else |
{ |
- ext.backgroundPage.sendMessage({ |
+ chrome.runtime.sendMessage({ |
type: "elemhide.injectSelectors", |
selectors |
}); |
} |
if (this.tracer) |
this.tracer.addSelectors(selectors, filters); |
}, |
hideElements(elements, filters) |
{ |
for (let element of elements) |
hideElement(element); |
if (this.tracer) |
{ |
- ext.backgroundPage.sendMessage({ |
+ chrome.runtime.sendMessage({ |
type: "devtools.traceElemHide", |
selectors: [], |
filters |
}); |
} |
}, |
apply() |
{ |
- ext.backgroundPage.sendMessage({type: "elemhide.getSelectors"}, response => |
+ chrome.runtime.sendMessage({type: "elemhide.getSelectors"}, response => |
{ |
if (this.tracer) |
this.tracer.disconnect(); |
this.tracer = null; |
if (this.style && this.style.parentElement) |
this.style.parentElement.removeChild(this.style); |
this.style = null; |