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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 tabs.forEach(tab => | 544 tabs.forEach(tab => |
545 { | 545 { |
546 chrome.webNavigation.getAllFrames({tabId: tab.id}, details => | 546 chrome.webNavigation.getAllFrames({tabId: tab.id}, details => |
547 { | 547 { |
548 if (details && details.length > 0) | 548 if (details && details.length > 0) |
549 { | 549 { |
550 let frames = new Map(); | 550 let frames = new Map(); |
551 framesOfTabs.set(tab.id, frames); | 551 framesOfTabs.set(tab.id, frames); |
552 | 552 |
553 for (let detail of details) | 553 for (let detail of details) |
554 frames.set(detail.frameId, {url: new URL(detail.url)}); | |
555 | |
556 for (let detail of details) | |
557 { | 554 { |
558 let {parentFrameId} = detail; | 555 let frame = {url: new URL(detail.url)}; |
559 | 556 frames.set(detail.frameId, frame); |
560 if (parentFrameId != -1) | 557 |
561 frames.get(detail.frameId).parent = frames.get(parentFrameId); | 558 if (detail.parentFrameId != -1) |
| 559 frame.parent = frames.get(detail.parentFrameId); |
562 } | 560 } |
563 } | 561 } |
564 }); | 562 }); |
565 }); | 563 }); |
566 }); | 564 }); |
567 | 565 |
568 chrome.webRequest.onBeforeRequest.addListener(details => | 566 chrome.webRequest.onBeforeRequest.addListener(details => |
569 { | 567 { |
570 // The high-level code isn't interested in requests that aren't | 568 // The high-level code isn't interested in requests that aren't |
571 // related to a tab or requests loading a top-level document, | 569 // related to a tab or requests loading a top-level document, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 ext.windows = { | 730 ext.windows = { |
733 create(createData, callback) | 731 create(createData, callback) |
734 { | 732 { |
735 chrome.windows.create(createData, createdWindow => | 733 chrome.windows.create(createData, createdWindow => |
736 { | 734 { |
737 afterTabLoaded(callback)(createdWindow.tabs[0]); | 735 afterTabLoaded(callback)(createdWindow.tabs[0]); |
738 }); | 736 }); |
739 } | 737 } |
740 }; | 738 }; |
741 }()); | 739 }()); |
LEFT | RIGHT |