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-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 30 matching lines...) Expand all Loading... | |
41 /* Utilities */ | 41 /* Utilities */ |
42 | 42 |
43 function getFiltersForElement(element, callback) | 43 function getFiltersForElement(element, callback) |
44 { | 44 { |
45 let src = element.getAttribute("src"); | 45 let src = element.getAttribute("src"); |
46 ext.backgroundPage.sendMessage( | 46 ext.backgroundPage.sendMessage( |
47 { | 47 { |
48 type: "composer.getFilters", | 48 type: "composer.getFilters", |
49 tagName: element.localName, | 49 tagName: element.localName, |
50 id: element.id, | 50 id: element.id, |
51 src: src && src.length < 1000 && src, | 51 src: src && src.length <= 1000 ? src : null, |
Sebastian Noack
2016/10/14 17:32:32
This expression is quite weird. Besides that it is
kzar
2016/10/14 17:48:58
Yea you're right, it was pretty weird to be fair :
| |
52 style: element.getAttribute("style"), | 52 style: element.getAttribute("style"), |
53 classes: Array.prototype.slice.call(element.classList), | 53 classes: Array.prototype.slice.call(element.classList), |
54 urls: getURLsFromElement(element), | 54 urls: getURLsFromElement(element), |
55 mediatype: typeMap[element.localName], | 55 mediatype: typeMap[element.localName], |
56 baseURL: document.location.href | 56 baseURL: document.location.href |
57 }, | 57 }, |
58 response => | 58 response => |
59 { | 59 { |
60 callback(response.filters, response.selectors); | 60 callback(response.filters, response.selectors); |
61 }); | 61 }); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
577 } | 577 } |
578 }); | 578 }); |
579 } | 579 } |
580 break; | 580 break; |
581 } | 581 } |
582 }); | 582 }); |
583 | 583 |
584 if (window == window.top) | 584 if (window == window.top) |
585 ext.backgroundPage.sendMessage({type: "composer.ready"}); | 585 ext.backgroundPage.sendMessage({type: "composer.ready"}); |
586 } | 586 } |
LEFT | RIGHT |