| Left: | ||
| Right: |
| 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-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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 528 | 528 |
| 529 for (let detail of details) | 529 for (let detail of details) |
| 530 { | 530 { |
| 531 let frame = {url: new URL(detail.url)}; | 531 let frame = {url: new URL(detail.url)}; |
| 532 frames.set(detail.frameId, frame); | 532 frames.set(detail.frameId, frame); |
| 533 | 533 |
| 534 if (detail.parentFrameId != -1) | 534 if (detail.parentFrameId != -1) |
| 535 { | 535 { |
| 536 frame.parent = frames.get(detail.parentFrameId); | 536 frame.parent = frames.get(detail.parentFrameId); |
| 537 | 537 |
| 538 if (!frame.parent && detail.parentFrameId != 0) | 538 if (!frame.parent && detail.parentFrameId > 0) |
|
Sebastian Noack
2018/07/25 19:31:24
Why not falling back to the top-level frame here i
Sebastian Noack
2018/07/25 19:31:24
Nit: Above you check for parentFrameId > 0, here y
kzar
2018/07/25 20:28:25
Well, if the parentFrameId is -1 I figure it's the
kzar
2018/07/25 20:28:25
Done.
| |
| 539 frame.parent = frames.get(0); | 539 frame.parent = frames.get(0); |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 }); | 543 }); |
| 544 }); | 544 }); |
| 545 }); | 545 }); |
| 546 | 546 |
| 547 | 547 |
| 548 /* Message passing */ | 548 /* Message passing */ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 return frames.get(0) || null; | 599 return frames.get(0) || null; |
| 600 } | 600 } |
| 601 }; | 601 }; |
| 602 } | 602 } |
| 603 | 603 |
| 604 return ext.onMessage._dispatch( | 604 return ext.onMessage._dispatch( |
| 605 message, sender, sendResponse | 605 message, sender, sendResponse |
| 606 ).includes(true); | 606 ).includes(true); |
| 607 }); | 607 }); |
| 608 } | 608 } |
| LEFT | RIGHT |