Index: test/abp2blocklist.js |
diff --git a/test/abp2blocklist.js b/test/abp2blocklist.js |
index adf3fb6f23ab0dbff17f3034636a3b1841810411..fbc4f7d752cae60a9c520c1ff2b886a5b25ebd2a 100644 |
--- a/test/abp2blocklist.js |
+++ b/test/abp2blocklist.js |
@@ -73,7 +73,7 @@ exports.generateRules = { |
"resource-type": ["image", "style-sheet", "script", "font", |
"media", "raw", "document"]}, |
action: {type: "block"}}, |
- {trigger: {"url-filter": "^https?://test\\.com", |
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?test\\.com", |
"url-filter-is-case-sensitive": true, |
"resource-type": ["image", "style-sheet", "script", "font", |
"media", "raw", "document"]}, |
@@ -84,6 +84,16 @@ exports.generateRules = { |
action: {type: "block"}} |
]); |
+ testRules(test, ["||example.com"], [ |
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com", |
+ "url-filter-is-case-sensitive": true, |
+ "resource-type": ["image", "style-sheet", "script", "font", |
+ "media", "raw", "document"]}, |
+ |
+ action: {type: "block"}} |
+ ]); |
+ |
+ |
test.done(); |
}, |
@@ -96,6 +106,14 @@ exports.generateRules = { |
action: {type: "ignore-previous-rules"}} |
]); |
+ testRules(test, ["@@||example.com"], [ |
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com", |
+ "url-filter-is-case-sensitive": true, |
+ "resource-type": ["image", "style-sheet", "script", "font", |
+ "media", "raw", "document"]}, |
+ action: {type: "ignore-previous-rules"}} |
+ ]); |
+ |
test.done(); |
}, |
@@ -120,13 +138,13 @@ exports.generateRules = { |
{trigger: {"url-filter": ".*", |
"if-domain": ["example.com", "www.example.com"]}, |
action: {type: "ignore-previous-rules"}}, |
- {trigger: {"url-filter": "^https?://example\\.com", |
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com", |
"url-filter-is-case-sensitive": true, |
"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", |
"resource-type": ["font"]}, |
action: {type: "ignore-previous-rules"}} |
]); |