Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 29573726: Issue 4580 - Replace ext.backgroundPage.sendMessage with runtime.sendMessage (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Oct. 11, 2017, 2:54 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ext/common.js ('k') | inject.preload.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ext/common.js ('k') | inject.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld