Index: test/abp2blocklist.js |
=================================================================== |
--- a/test/abp2blocklist.js |
+++ b/test/abp2blocklist.js |
@@ -57,19 +57,19 @@ |
// (4) exceptions for all rules. |
testRules(test, [ |
"##.whatever", |
"test.com###something", |
"@@||special.test.com^$elemhide", |
"@@||test.com^$generichide" |
], [ |
["^https?://", "css-display-none"], |
- ["^https?://([^/]+\\.)?test\\.com", "ignore-previous-rules"], |
+ ["^https?://([^/]+\\.)?test\\.com([^.%A-Za-z0-9_].*)?$", "ignore-previous-rules"], |
["^https?://([^/:]*\\.)?test\\.com[/:]", "css-display-none"], |
- ["^https?://([^/]+\\.)?special\\.test\\.com", "ignore-previous-rules"] |
+ ["^https?://([^/]+\\.)?special\\.test\\.com([^.%A-Za-z0-9_].*)?$", "ignore-previous-rules"] |
], rules => rules.map(rule => [rule.trigger["url-filter"], |
rule.action.type])); |
testRules(test, ["#@#whatever"], []); |
testRules(test, ["test.com#@#whatever"], []); |
testRules(test, ["~test.com#@#whatever"], []); |
// We currently completely ignore any element hiding filters that have the |
@@ -157,23 +157,22 @@ |
{trigger: {"url-filter": ".*", |
"if-domain": ["*example.com"]}, |
action: {type: "ignore-previous-rules"}} |
]); |
testRules(test, ["@@||example.com^$document,image"], [ |
{trigger: {"url-filter": ".*", |
"if-domain": ["*example.com"]}, |
action: {type: "ignore-previous-rules"}}, |
- {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com", |
- "url-filter-is-case-sensitive": true, |
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com([^.%A-Za-z0-9_].*)?$", |
"resource-type": ["image"]}, |
action: {type: "ignore-previous-rules"}} |
]); |
testRules(test, ["@@||example.com/path^$font,document"], [ |
- {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com/path", |
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com/path([^.%A-Za-z0-9_].*)?$", |
"resource-type": ["font"]}, |
action: {type: "ignore-previous-rules"}} |
]); |
test.done(); |
}, |
testGenericblockExceptions: function(test) |