LEFT | RIGHT |
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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 let results = ext.webRequest.onBeforeRequest._dispatch( | 536 let results = ext.webRequest.onBeforeRequest._dispatch( |
537 new URL(details.url), | 537 new URL(details.url), |
538 type.toUpperCase(), | 538 type.toUpperCase(), |
539 new Page({id: details.tabId}), | 539 new Page({id: details.tabId}), |
540 frame | 540 frame |
541 ); | 541 ); |
542 | 542 |
543 if (results.indexOf(false) != -1) | 543 if (results.indexOf(false) != -1) |
544 return {cancel: true}; | 544 return {cancel: true}; |
545 } | 545 } |
546 }, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]); | 546 }, {urls: ["<all_urls>"]}, ["blocking"]); |
547 | 547 |
548 | 548 |
549 /* Message passing */ | 549 /* Message passing */ |
550 | 550 |
551 chrome.runtime.onMessage.addListener((message, rawSender, sendResponse) => | 551 chrome.runtime.onMessage.addListener((message, rawSender, sendResponse) => |
552 { | 552 { |
553 let sender = {}; | 553 let sender = {}; |
554 | 554 |
555 // Add "page" and "frame" if the message was sent by a content script. | 555 // Add "page" and "frame" if the message was sent by a content script. |
556 // If sent by popup or the background page itself, there is no "tab". | 556 // If sent by popup or the background page itself, there is no "tab". |
(...skipping 117 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 chrome.windows.create(createData, createdWindow => | 677 chrome.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 }()); |
LEFT | RIGHT |