LEFT | RIGHT |
| 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * |
| 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 |
| 7 * published by the Free Software Foundation. |
| 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ |
| 17 |
1 "use strict"; | 18 "use strict"; |
2 | 19 |
3 let { | 20 let { |
4 Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter, | 21 Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter, |
5 BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, | 22 BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, |
6 ElemHideException, CSSPropertyFilter | 23 ElemHideException, CSSPropertyFilter |
7 } = require("../lib/filterClasses"); | 24 } = require("../lib/filterClasses"); |
8 | 25 |
9 function serializeFilter(filter) | 26 function serializeFilter(filter) |
10 { | 27 { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 compareFilter(test, "foo.com,~bar##[-abp-properties='abc']", ["type=cssrule",
"text=foo.com,~bar##[-abp-properties='abc']", "selectorDomain=foo.com", "selecto
r=[-abp-properties='abc']", "domains=FOO.COM|~BAR", "regexp=abc"]); | 336 compareFilter(test, "foo.com,~bar##[-abp-properties='abc']", ["type=cssrule",
"text=foo.com,~bar##[-abp-properties='abc']", "selectorDomain=foo.com", "selecto
r=[-abp-properties='abc']", "domains=FOO.COM|~BAR", "regexp=abc"]); |
320 compareFilter(test, "~foo.com,bar.com##[-abp-properties='abc']", ["type=cssrul
e", "text=~foo.com,bar.com##[-abp-properties='abc']", "selectorDomain=bar.com",
"selector=[-abp-properties='abc']", "domains=BAR.COM|~FOO.COM", "regexp=abc"]); | 337 compareFilter(test, "~foo.com,bar.com##[-abp-properties='abc']", ["type=cssrul
e", "text=~foo.com,bar.com##[-abp-properties='abc']", "selectorDomain=bar.com",
"selector=[-abp-properties='abc']", "domains=BAR.COM|~FOO.COM", "regexp=abc"]); |
321 | 338 |
322 compareFilter(test, "##[-abp-properties='']", ["type=elemhide", "text=##[-abp-
properties='']", "selector=[-abp-properties='']"]); | 339 compareFilter(test, "##[-abp-properties='']", ["type=elemhide", "text=##[-abp-
properties='']", "selector=[-abp-properties='']"]); |
323 compareFilter(test, "foo.com#@#[-abp-properties='abc']", ["type=elemhideexcept
ion", "text=foo.com#@#[-abp-properties='abc']", "selectorDomain=foo.com", "selec
tor=[-abp-properties='abc']", "domains=FOO.COM"]); | 340 compareFilter(test, "foo.com#@#[-abp-properties='abc']", ["type=elemhideexcept
ion", "text=foo.com#@#[-abp-properties='abc']", "selectorDomain=foo.com", "selec
tor=[-abp-properties='abc']", "domains=FOO.COM"]); |
324 compareFilter(test, "foo.com##aaa [-abp-properties='abc'] bbb", ["type=cssrule
", "text=foo.com##aaa [-abp-properties='abc'] bbb", "selectorDomain=foo.com", "s
elector=aaa [-abp-properties='abc'] bbb", "domains=FOO.COM", "prefix=aaa ", "reg
exp=abc", "suffix= bbb"]); | 341 compareFilter(test, "foo.com##aaa [-abp-properties='abc'] bbb", ["type=cssrule
", "text=foo.com##aaa [-abp-properties='abc'] bbb", "selectorDomain=foo.com", "s
elector=aaa [-abp-properties='abc'] bbb", "domains=FOO.COM", "prefix=aaa ", "reg
exp=abc", "suffix= bbb"]); |
325 compareFilter(test, "foo.com##[-abp-properties='|background-image: url(data:*)
']", ["type=cssrule", "text=foo.com##[-abp-properties='|background-image: url(da
ta:*)']", "selectorDomain=foo.com", "selector=[-abp-properties='|background-imag
e: url(data:*)']", "domains=FOO.COM", "regexp=^background\\-image\\:\\ url\\(dat
a\\:.*\\)"]); | 342 compareFilter(test, "foo.com##[-abp-properties='|background-image: url(data:*)
']", ["type=cssrule", "text=foo.com##[-abp-properties='|background-image: url(da
ta:*)']", "selectorDomain=foo.com", "selector=[-abp-properties='|background-imag
e: url(data:*)']", "domains=FOO.COM", "regexp=^background\\-image\\:\\ url\\(dat
a\\:.*\\)"]); |
326 | 343 |
327 test.done(); | 344 test.done(); |
328 }; | 345 }; |
LEFT | RIGHT |