Left: | ||
Right: |
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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 return [new PlainSelector(selector)]; | 144 return [new PlainSelector(selector)]; |
145 | 145 |
146 let selectors = []; | 146 let selectors = []; |
147 if (match.index > 0) | 147 if (match.index > 0) |
148 selectors.push(new PlainSelector(selector.substr(0, match.index))); | 148 selectors.push(new PlainSelector(selector.substr(0, match.index))); |
149 | 149 |
150 let startIndex = match.index + match[0].length; | 150 let startIndex = match.index + match[0].length; |
151 let content = parseSelectorContent(selector, startIndex); | 151 let content = parseSelectorContent(selector, startIndex); |
152 if (!content) | 152 if (!content) |
153 { | 153 { |
154 console.error(new SyntaxError("Failed parsing ABP " + | 154 console.error(new SyntaxError("Failed parsing ABP " + |
kzar
2017/06/12 14:12:44
These changes seem unrelated? (Same below.)
hub
2017/06/12 14:30:26
you are looking at the interdiff.... it is not in
| |
155 `selector ${selector}, didn't ` + | 155 `selector ${selector}, didn't ` + |
156 "find closing parenthesis.")); | 156 "find closing parenthesis.")); |
157 return null; | 157 return null; |
158 } | 158 } |
159 if (match[1] == "properties") | 159 if (match[1] == "properties") |
160 selectors.push(new PropsSelector(content.text)); | 160 selectors.push(new PropsSelector(content.text)); |
161 else if (match[1] == "has") | 161 else if (match[1] == "has") |
162 { | 162 { |
163 let hasSelector = new HasSelector(content.text); | 163 let hasSelector = new HasSelector(content.text); |
164 if (!hasSelector.valid()) | 164 if (!hasSelector.valid()) |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 | 445 |
446 if (this.patterns.length > 0) | 446 if (this.patterns.length > 0) |
447 { | 447 { |
448 let {document} = this.window; | 448 let {document} = this.window; |
449 this.addSelectors(document.styleSheets); | 449 this.addSelectors(document.styleSheets); |
450 document.addEventListener("load", this.onLoad.bind(this), true); | 450 document.addEventListener("load", this.onLoad.bind(this), true); |
451 } | 451 } |
452 }); | 452 }); |
453 } | 453 } |
454 }; | 454 }; |
455 | |
456 if (typeof exports != "undefined") | |
457 { | |
458 exports.ElemHideEmulation = ElemHideEmulation; | |
459 exports.splitSelector = splitSelector; | |
460 } | |
OLD | NEW |