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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1125 return new InvalidFilter(text, "filter_invalid_domain"); | 1125 return new InvalidFilter(text, "filter_invalid_domain"); |
1126 | 1126 |
1127 if (type == "@") | 1127 if (type == "@") |
1128 return new ElemHideException(text, domains, body); | 1128 return new ElemHideException(text, domains, body); |
1129 | 1129 |
1130 if (type == "?" || type == "$") | 1130 if (type == "?" || type == "$") |
1131 { | 1131 { |
1132 // Element hiding emulation and snippet filters are inefficient so we need | 1132 // Element hiding emulation and snippet filters are inefficient so we need |
1133 // to make sure that they're only applied if they specify active domains | 1133 // to make sure that they're only applied if they specify active domains |
1134 if (!(/,[^~][^,.]*\.[^,]/.test("," + domains) || | 1134 if (!(/,[^~][^,.]*\.[^,]/.test("," + domains) || |
1135 /,localhost,/.test("," + domains + ","))) | 1135 ("," + domains + ",").includes(",localhost,"))) |
Sebastian Noack
2018/09/10 17:44:37
It seems we don't need a regular expression here,
Manish Jethani
2018/09/10 17:57:32
Good point, done.
| |
1136 { | 1136 { |
1137 return new InvalidFilter(text, type == "?" ? | 1137 return new InvalidFilter(text, type == "?" ? |
1138 "filter_elemhideemulation_nodomain" : | 1138 "filter_elemhideemulation_nodomain" : |
1139 "filter_snippet_nodomain"); | 1139 "filter_snippet_nodomain"); |
1140 } | 1140 } |
1141 | 1141 |
1142 if (type == "?") | 1142 if (type == "?") |
1143 return new ElemHideEmulationFilter(text, domains, body); | 1143 return new ElemHideEmulationFilter(text, domains, body); |
1144 | 1144 |
1145 return new SnippetFilter(text, domains, body); | 1145 return new SnippetFilter(text, domains, body); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1248 | 1248 |
1249 /** | 1249 /** |
1250 * Script that should be executed | 1250 * Script that should be executed |
1251 * @type {string} | 1251 * @type {string} |
1252 */ | 1252 */ |
1253 get script() | 1253 get script() |
1254 { | 1254 { |
1255 return this.body; | 1255 return this.body; |
1256 } | 1256 } |
1257 }); | 1257 }); |
LEFT | RIGHT |