Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -359,16 +359,21 @@ |
compareFilter(test, "foo.com,~bar##[-abp-properties='abc']", ["type=cssrule", "text=foo.com,~bar##[-abp-properties='abc']", "selectorDomain=foo.com", "selector=[-abp-properties='abc']", "domains=FOO.COM|~BAR", "regexp=abc"]); |
compareFilter(test, "~foo.com,bar.com##[-abp-properties='abc']", ["type=cssrule", "text=~foo.com,bar.com##[-abp-properties='abc']", "selectorDomain=bar.com", "selector=[-abp-properties='abc']", "domains=BAR.COM|~FOO.COM", "regexp=abc"]); |
compareFilter(test, "##[-abp-properties='']", ["type=elemhide", "text=##[-abp-properties='']", "selector=[-abp-properties='']"]); |
compareFilter(test, "foo.com#@#[-abp-properties='abc']", ["type=elemhideexception", "text=foo.com#@#[-abp-properties='abc']", "selectorDomain=foo.com", "selector=[-abp-properties='abc']", "domains=FOO.COM"]); |
compareFilter(test, "foo.com##aaa [-abp-properties='abc'] bbb", ["type=cssrule", "text=foo.com##aaa [-abp-properties='abc'] bbb", "selectorDomain=foo.com", "selector=aaa [-abp-properties='abc'] bbb", "domains=FOO.COM", "prefix=aaa ", "regexp=abc", "suffix= bbb"]); |
compareFilter(test, "foo.com##[-abp-properties='|background-image: url(data:*)']", ["type=cssrule", "text=foo.com##[-abp-properties='|background-image: url(data:*)']", "selectorDomain=foo.com", "selector=[-abp-properties='|background-image: url(data:*)']", "domains=FOO.COM", "regexp=^background\\-image\\:\\ url\\(data\\:.*\\)"]); |
+ // Test regexp property matching |
+ compareFilter(test, "foo.com##[-abp-properties='/abc']", ["type=cssrule", "text=foo.com##[-abp-properties='/abc']", "selectorDomain=foo.com", "selector=[-abp-properties='/abc']", "domains=FOO.COM", "regexp=\\/abc"]); |
+ compareFilter(test, "foo.com##[-abp-properties='abc/']", ["type=cssrule", "text=foo.com##[-abp-properties='abc/']", "selectorDomain=foo.com", "selector=[-abp-properties='abc/']", "domains=FOO.COM", "regexp=abc\\/"]); |
+ compareFilter(test, "foo.com##[-abp-properties='/abc/']", ["type=cssrule", "text=foo.com##[-abp-properties='/abc/']", "selectorDomain=foo.com", "selector=[-abp-properties='/abc/']", "domains=FOO.COM", "regexp=abc"]); |
+ |
test.done(); |
}; |
exports.testEmptyElemHideDomains = function(test) |
{ |
let emptyDomainFilters = [ |
",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector", |
",foo.com##selector", "foo.com,~##selector", |