-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement hosts-only mode #2115
Conversation
packages/adblocker-benchmarks/run.js
Outdated
@@ -80,10 +80,31 @@ function isSupportedUrl(url) { | |||
); | |||
} | |||
|
|||
function looksLikeHostFilter(raw) { | |||
// https://en.wikipedia.org/wiki/Hostname#Syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gorhill this is my idea of what a host filter is. I hope I've got it right! Let me know if you think I've missed something.
The resulting list following extracting looks-like-filter function is rather small, something around 3,800 if I remember correctly. Typically, I expect DNS block list to be much larger. I went ahead and created a Tell me if you are interested. |
Looks good to me! The license is Unlicense. We could include the generated @gorhill how do I get this file from you? Maybe you could submit it as a patch, or upload it somewhere so I can fetch it and include it in this patch. |
Looks like I can attach it here: hosts.txt.zip |
@remusao the patch is a lot simpler now and marked ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks a lot!
This PR introduces a hosts-only mode. The idea is to benchmark with only "host filters." An engine could be used in this mode for DNS-level or proxy-level blocking.
A
hosts.txt
file is included based on The Block List Project (see #2115 (comment)).Pass the
HOSTS_ONLY=1
option tomake
to run in hosts-only mode.