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-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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 Filter.fromText = function(text) | 120 Filter.fromText = function(text) |
121 { | 121 { |
122 let filter = Filter.knownFilters.get(text); | 122 let filter = Filter.knownFilters.get(text); |
123 if (filter) | 123 if (filter) |
124 return filter; | 124 return filter; |
125 | 125 |
126 let match = text.includes("#") ? Filter.contentRegExp.exec(text) : null; | 126 let match = text.includes("#") ? Filter.contentRegExp.exec(text) : null; |
127 if (match) | 127 if (match) |
128 { | 128 { |
129 let propsMatch; | 129 let propsMatch; |
130 if (!match[2] && | 130 if (!match[2] && match[3].includes("[-") && |
131 (propsMatch = /\[-abp-properties=(["'])([^"']+)\1\]/.exec(match[3]))) | 131 (propsMatch = /\[-abp-properties=(["'])([^"']+)\1\]/.exec(match[3]))) |
132 { | 132 { |
133 // This is legacy CSS properties syntax, convert to current syntax | 133 // This is legacy CSS properties syntax, convert to current syntax |
134 let prefix = match[3].substr(0, propsMatch.index); | 134 let prefix = match[3].substr(0, propsMatch.index); |
135 let expression = propsMatch[2]; | 135 let expression = propsMatch[2]; |
136 let suffix = match[3].substr(propsMatch.index + propsMatch[0].length); | 136 let suffix = match[3].substr(propsMatch.index + propsMatch[0].length); |
137 return Filter.fromText(`${match[1]}#?#` + | 137 return Filter.fromText(`${match[1]}#?#` + |
138 `${prefix}:-abp-properties(${expression})${suffix}`); | 138 `${prefix}:-abp-properties(${expression})${suffix}`); |
139 } | 139 } |
140 | 140 |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 | 1187 |
1188 /** | 1188 /** |
1189 * Script that should be executed | 1189 * Script that should be executed |
1190 * @type {string} | 1190 * @type {string} |
1191 */ | 1191 */ |
1192 get script() | 1192 get script() |
1193 { | 1193 { |
1194 return this.body; | 1194 return this.body; |
1195 } | 1195 } |
1196 }); | 1196 }); |
OLD | NEW |