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

Unified Diff: inject.preload.js

Issue 29573726: Issue 4580 - Replace ext.backgroundPage.sendMessage with runtime.sendMessage (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Rebase Created Oct. 13, 2017, 5:07 a.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 | « include.preload.js ('k') | subscriptionLink.postload.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: inject.preload.js
===================================================================
--- a/inject.preload.js
+++ b/inject.preload.js
@@ -20,17 +20,17 @@
let randomEventName = "abp-request-" + Math.random().toString(36).substr(2);
// Proxy "should we block?" messages from checkRequest inside the injected
// code to the background page and back again.
document.addEventListener(randomEventName, event =>
{
let {url, requestType} = event.detail;
- ext.backgroundPage.sendMessage({
+ chrome.runtime.sendMessage({
type: "request.blockedByWrapper",
requestType,
url
}, block =>
{
document.dispatchEvent(new CustomEvent(
randomEventName + "-" + requestType + "-" + url, {detail: block}
));
« no previous file with comments | « include.preload.js ('k') | subscriptionLink.postload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld