OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 filterlistsReinitialized: false, | 72 filterlistsReinitialized: false, |
73 addSubscription: false, | 73 addSubscription: false, |
74 filterError: false, | 74 filterError: false, |
75 downloadStatus: "synchronize_ok", | 75 downloadStatus: "synchronize_ok", |
76 showNotificationUI: false, | 76 showNotificationUI: false, |
77 showPageOptions: false | 77 showPageOptions: false |
78 }; | 78 }; |
79 updateFromURL(params); | 79 updateFromURL(params); |
80 | 80 |
81 let modules = {}; | 81 let modules = {}; |
82 window.require = function(module) | 82 |
83 { | 83 const require = window.require = module => modules[module]; |
84 return modules[module]; | |
85 }; | |
86 | 84 |
87 modules.utils = { | 85 modules.utils = { |
88 Utils: { | 86 Utils: { |
89 getDocLink(link) | 87 getDocLink(link) |
90 { | 88 { |
91 return "https://adblockplus.org/redirect?link=" + encodeURIComponent(lin
k); | 89 return "https://adblockplus.org/redirect?link=" + encodeURIComponent(lin
k); |
92 }, | 90 }, |
93 get appLocale() | 91 get appLocale() |
94 { | 92 { |
95 return chrome.i18n.getUILanguage(); | 93 return chrome.i18n.getUILanguage(); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 { | 532 { |
535 host, | 533 host, |
536 whitelisted: isWhitelisted | 534 whitelisted: isWhitelisted |
537 } | 535 } |
538 ] | 536 ] |
539 } | 537 } |
540 }, "*"); | 538 }, "*"); |
541 }, 1000); | 539 }, 1000); |
542 } | 540 } |
543 | 541 |
544 ext.devtools.onCreated.addListener((panel) => | 542 let {port} = require("messaging"); |
| 543 |
| 544 port.on("devtools.ready", (message, sender) => |
545 { | 545 { |
| 546 let panel = sender.page; |
| 547 |
546 // blocked request | 548 // blocked request |
547 panel.sendMessage({ | 549 panel.sendMessage({ |
548 type: "add-record", | 550 type: "add-record", |
549 request: { | 551 request: { |
550 url: "http://adserver.example.com/ad_banner.png", | 552 url: "http://adserver.example.com/ad_banner.png", |
551 type: "IMAGE", | 553 type: "IMAGE", |
552 docDomain: "example.com" | 554 docDomain: "example.com" |
553 }, | 555 }, |
554 filter: { | 556 filter: { |
555 text: "/ad_banner*$domain=example.com", | 557 text: "/ad_banner*$domain=example.com", |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 }, | 613 }, |
612 filter: { | 614 filter: { |
613 text: "||example.com/some-annoying-popup$popup", | 615 text: "||example.com/some-annoying-popup$popup", |
614 whitelisted: false, | 616 whitelisted: false, |
615 userDefined: true, | 617 userDefined: true, |
616 subscription: null | 618 subscription: null |
617 } | 619 } |
618 }); | 620 }); |
619 }); | 621 }); |
620 }()); | 622 }()); |
OLD | NEW |