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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // document_start content scripts (like this one) don't | 552 // document_start content scripts (like this one) don't |
553 // run either in those frames due to https://crbug.com/416907. | 553 // run either in those frames due to https://crbug.com/416907. |
554 // So we have to apply element hiding from the parent frame. | 554 // So we have to apply element hiding from the parent frame. |
555 if (!("init" in contentWindow)) | 555 if (!("init" in contentWindow)) |
556 init(contentDocument); | 556 init(contentDocument); |
557 | 557 |
558 // Moreover, "load" and "error" events aren't dispatched for elements | 558 // Moreover, "load" and "error" events aren't dispatched for elements |
559 // in dynamically created frames due to https://crbug.com/442107. | 559 // in dynamically created frames due to https://crbug.com/442107. |
560 // So we also have to apply element collpasing from the parent frame. | 560 // So we also have to apply element collpasing from the parent frame. |
561 if (!contentWindow.collapsing) | 561 if (!contentWindow.collapsing) |
562 [].forEach.call(contentDocument.querySelectorAll(Object.keys(typeMap
).join(",")), checkCollapse); | 562 Array.prototype.forEach.call( |
| 563 contentDocument.querySelectorAll(Object.keys(typeMap).join(",")), |
| 564 checkCollapse |
| 565 ); |
563 } | 566 } |
564 } | 567 } |
565 } | 568 } |
566 }, true); | 569 }, true); |
567 | 570 |
568 return updateStylesheet; | 571 return updateStylesheet; |
569 } | 572 } |
570 | 573 |
571 if (document instanceof HTMLDocument) | 574 if (document instanceof HTMLDocument) |
572 { | 575 { |
573 checkSitekey(); | 576 checkSitekey(); |
574 window.updateStylesheet = init(document); | 577 window.updateStylesheet = init(document); |
575 } | 578 } |
OLD | NEW |