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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 | 1009 |
1010 /** | 1010 /** |
1011 * @see ActiveFilter.ignoreTrailingDot | 1011 * @see ActiveFilter.ignoreTrailingDot |
1012 */ | 1012 */ |
1013 ignoreTrailingDot: false, | 1013 ignoreTrailingDot: false, |
1014 | 1014 |
1015 /** | 1015 /** |
1016 * CSS selector for the HTML elements that should be hidden | 1016 * CSS selector for the HTML elements that should be hidden |
1017 * @type {string} | 1017 * @type {string} |
1018 */ | 1018 */ |
1019 selector: null, | 1019 selector: null |
1020 | |
1021 /** | |
1022 * Host names or domains the filter should be restricted to (can be null for | |
1023 * no restriction) | |
1024 * @type {?Array.<string>} | |
1025 */ | |
1026 get selectorDomains() | |
1027 { | |
1028 let {domains} = this; | |
1029 if (!domains) | |
1030 return null; | |
1031 | |
1032 return [...domains].filter(([domain, isIncluded]) => isIncluded) | |
1033 .map(([domain]) => domain.toLowerCase()); | |
1034 } | |
1035 }); | 1020 }); |
1036 | 1021 |
1037 /** | 1022 /** |
1038 * Creates an element hiding filter from a pre-parsed text representation | 1023 * Creates an element hiding filter from a pre-parsed text representation |
1039 * | 1024 * |
1040 * @param {string} text same as in Filter() | 1025 * @param {string} text same as in Filter() |
1041 * @param {string} [domains] | 1026 * @param {string} [domains] |
1042 * domains part of the text representation | 1027 * domains part of the text representation |
1043 * @param {string} [type] | 1028 * @param {string} [type] |
1044 * rule type, either empty or @ (exception) or ? (emulation rule) | 1029 * rule type, either empty or @ (exception) or ? (emulation rule) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 */ | 1101 */ |
1117 function ElemHideEmulationFilter(text, domains, selector) | 1102 function ElemHideEmulationFilter(text, domains, selector) |
1118 { | 1103 { |
1119 ElemHideBase.call(this, text, domains, selector); | 1104 ElemHideBase.call(this, text, domains, selector); |
1120 } | 1105 } |
1121 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; | 1106 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; |
1122 | 1107 |
1123 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { | 1108 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { |
1124 type: "elemhideemulation" | 1109 type: "elemhideemulation" |
1125 }); | 1110 }); |
LEFT | RIGHT |