You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There sub domain may have one than one depth. e.g. foo.example.com, foo.bar.example.com or foo.bar.foobar.example.com. So the match rule in url-filter should replace ? with * like "^[htpsw]+:\/\/([a-z0-9-]+\.)*example\.com\/foo\/bar$"
Use \\/ to escape / is not necessary. You may just use /. e.g. "^[htpsw]+://([a-z0-9-]+\.)*example\.com/foo/bar$"
We can experiment with this once again since the current rules were made a few years ago. However, the current regular expressions were chosen for a reason. Testing showed that there's a significant difference in compile time and the overall performance when we use a more narrow regex.
The main issue for this ticket is want to match subdomains with more than one depth. so maybe first step is use *to replace ? to solve the issue, then can run some performance testing to evaluate what is more effective regex.
Is there any reason use \\/ instead of / in url-filter?
Test Rule:
Generated rule:
There are two issues on this generated rule:
foo.example.com
,foo.bar.example.com
orfoo.bar.foobar.example.com
. So the match rule inurl-filter
should replace?
with*
like "^[htpsw]+:\/\/([a-z0-9-]+\.)*example\.com\/foo\/bar$"\\/
to escape/
is not necessary. You may just use/
. e.g. "^[htpsw]+://([a-z0-9-]+\.)*example\.com/foo/bar$"Regarding sub domain match, maybe refer to https://webkit.org/blog/4062/targeting-domains-with-content-blockers/ to write it in more effect way, e.g.
Note: use
*
instead of?
here to match multiple level of subdomains.The text was updated successfully, but these errors were encountered: