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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 details.parentFrameId); | 256 details.parentFrameId); |
257 }, | 257 }, |
258 {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]}, | 258 {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]}, |
259 ["responseHeaders"]); | 259 ["responseHeaders"]); |
260 | 260 |
261 browser.webNavigation.onBeforeNavigate.addListener(details => | 261 browser.webNavigation.onBeforeNavigate.addListener(details => |
262 { | 262 { |
263 // Since we can only listen for HTTP(S) responses using | 263 // Since we can only listen for HTTP(S) responses using |
264 // webRequest.onHeadersReceived we must update the page structure here for | 264 // webRequest.onHeadersReceived we must update the page structure here for |
265 // other navigations. | 265 // other navigations. |
266 let url = new URL(details.url); | 266 let {url} = details; |
267 if (url.protocol != "http:" && url.protocol != "https:") | 267 if (!url.startsWith("http:") && |
| 268 (!url.startsWith("https:") || |
| 269 // Chrome doesn't dispatch webRequest.onHeadersReceived |
| 270 // for Web Store URLs. |
| 271 url.startsWith("https://chrome.google.com/webstore/"))) |
268 { | 272 { |
269 updatePageFrameStructure(details.frameId, details.tabId, details.url, | 273 updatePageFrameStructure(details.frameId, details.tabId, url, |
270 details.parentFrameId); | 274 details.parentFrameId); |
271 } | 275 } |
272 }); | 276 }); |
273 | 277 |
274 function forgetTab(tabId) | 278 function forgetTab(tabId) |
275 { | 279 { |
276 ext.pages.onRemoved._dispatch(tabId); | 280 ext.pages.onRemoved._dispatch(tabId); |
277 | 281 |
278 ext._removeFromAllPageMaps(tabId); | 282 ext._removeFromAllPageMaps(tabId); |
279 framesOfTabs.delete(tabId); | 283 framesOfTabs.delete(tabId); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 ext.windows = { | 690 ext.windows = { |
687 create(createData, callback) | 691 create(createData, callback) |
688 { | 692 { |
689 browser.windows.create(createData, createdWindow => | 693 browser.windows.create(createData, createdWindow => |
690 { | 694 { |
691 afterTabLoaded(callback)(createdWindow.tabs[0]); | 695 afterTabLoaded(callback)(createdWindow.tabs[0]); |
692 }); | 696 }); |
693 } | 697 } |
694 }; | 698 }; |
695 } | 699 } |
OLD | NEW |