| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 if (!element.getAttribute("src")) | 139 if (!element.getAttribute("src")) |
| 140 return false; | 140 return false; |
| 141 | 141 |
| 142 for (let child of element.children) | 142 for (let child of element.children) |
| 143 { | 143 { |
| 144 // If the <video> or <audio> element contains any <source> or <track> | 144 // If the <video> or <audio> element contains any <source> or <track> |
| 145 // children, we cannot address it in CSS by the source URL; in that case we | 145 // children, we cannot address it in CSS by the source URL; in that case we |
| 146 // don't "collapse" it using a CSS selector but rather hide it directly by | 146 // don't "collapse" it using a CSS selector but rather hide it directly by |
| 147 // setting the style="..." attribute. | 147 // setting the style="..." attribute. |
| 148 if (["source", "track"].includes(child.localName)) | 148 if (child.localName == "source" || child.localName == "track") |
| 149 return false; | 149 return false; |
| 150 } | 150 } |
| 151 | 151 |
| 152 return true; | 152 return true; |
| 153 } | 153 } |
| 154 | 154 |
| 155 function collapseMediaElement(element, srcValue) | 155 function collapseMediaElement(element, srcValue) |
| 156 { | 156 { |
| 157 if (!srcValue) | 157 if (!srcValue) |
| 158 return; | 158 return; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 let element = event.target; | 598 let element = event.target; |
| 599 if (/^i?frame$/.test(element.localName)) | 599 if (/^i?frame$/.test(element.localName)) |
| 600 checkCollapse(element); | 600 checkCollapse(element); |
| 601 }, true); | 601 }, true); |
| 602 } | 602 } |
| 603 | 603 |
| 604 window.checkCollapse = checkCollapse; | 604 window.checkCollapse = checkCollapse; |
| 605 window.elemhide = elemhide; | 605 window.elemhide = elemhide; |
| 606 window.typeMap = typeMap; | 606 window.typeMap = typeMap; |
| 607 window.getURLsFromElement = getURLsFromElement; | 607 window.getURLsFromElement = getURLsFromElement; |
| LEFT | RIGHT |