| Index: background.js |
| =================================================================== |
| --- a/background.js |
| +++ b/background.js |
| @@ -74,20 +74,18 @@ |
| filterError: false, |
| downloadStatus: "synchronize_ok", |
| showNotificationUI: false, |
| showPageOptions: false |
| }; |
| updateFromURL(params); |
| let modules = {}; |
| - window.require = function(module) |
| - { |
| - return modules[module]; |
| - }; |
| + |
| + const require = window.require = module => modules[module]; |
| modules.utils = { |
| Utils: { |
| getDocLink(link) |
| { |
| return "https://adblockplus.org/redirect?link=" + encodeURIComponent(link); |
| }, |
| get appLocale() |
| @@ -536,18 +534,22 @@ |
| whitelisted: isWhitelisted |
| } |
| ] |
| } |
| }, "*"); |
| }, 1000); |
| } |
| - ext.devtools.onCreated.addListener((panel) => |
| + let {port} = require("messaging"); |
| + |
| + port.on("devtools.ready", (message, sender) => |
| { |
| + let panel = sender.page; |
| + |
| // blocked request |
| panel.sendMessage({ |
| type: "add-record", |
| request: { |
| url: "http://adserver.example.com/ad_banner.png", |
| type: "IMAGE", |
| docDomain: "example.com" |
| }, |