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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 let page = null; | 602 let page = null; |
603 if (details.tabId != -1) | 603 if (details.tabId != -1) |
604 { | 604 { |
605 frame = ext.getFrame(details.tabId, frameId); | 605 frame = ext.getFrame(details.tabId, frameId); |
606 page = new Page({id: details.tabId}); | 606 page = new Page({id: details.tabId}); |
607 } | 607 } |
608 | 608 |
609 if (ext.webRequest.onBeforeRequest._dispatch( | 609 if (ext.webRequest.onBeforeRequest._dispatch( |
610 url, type, page, frame).includes(false)) | 610 url, type, page, frame).includes(false)) |
611 return {cancel: true}; | 611 return {cancel: true}; |
612 }, {urls: ["<all_urls>"]}, ["blocking"]); | 612 }, {urls: ["*://*/*"]}, ["blocking"]); |
613 | 613 |
614 | 614 |
615 /* Message passing */ | 615 /* Message passing */ |
616 | 616 |
617 browser.runtime.onMessage.addListener((message, rawSender, sendResponse) => | 617 browser.runtime.onMessage.addListener((message, rawSender, sendResponse) => |
618 { | 618 { |
619 let sender = {}; | 619 let sender = {}; |
620 | 620 |
621 // Add "page" and "frame" if the message was sent by a content script. | 621 // Add "page" and "frame" if the message was sent by a content script. |
622 // If sent by popup or the background page itself, there is no "tab". | 622 // If sent by popup or the background page itself, there is no "tab". |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 ext.windows = { | 674 ext.windows = { |
675 create(createData, callback) | 675 create(createData, callback) |
676 { | 676 { |
677 browser.windows.create(createData, createdWindow => | 677 browser.windows.create(createData, createdWindow => |
678 { | 678 { |
679 afterTabLoaded(callback)(createdWindow.tabs[0]); | 679 afterTabLoaded(callback)(createdWindow.tabs[0]); |
680 }); | 680 }); |
681 } | 681 } |
682 }; | 682 }; |
683 } | 683 } |
OLD | NEW |