Using uBlock Origin, How Do I Block a Root Site Without Blocking Sub-Pages?

I am getting really distracted by YouTube recently, but I still need access to YouTube videos. I inadvertently visit youtube.com, and I would like to block this page without blocking the whole site. Is there a uBlock filter that only works on the root page?

1

2 Answers

Is there a [uBlock Origin] filter that only works on the root page?

Yes, use the document filter option:

||youtube.com^|$document
4

With Squid Cache Rule:

acl whitedomains dstdomain -i "/path_to_acl/whitedomains.txt"
acl blackdomains dstdomain -i "/path_to_acl/blackdomains.txt"
http_access allow whitedomains
http_access deny blackdomains

Content of the lists:

/path_to_acl/whitedomains.txt
.account.youtube.com
.google.com

/path_to_acl/blackdomains.txt
.youtube.com
.googlevideo.com
.ytimg.com

PD: Since February 2014, Google uses the accounts subdomain .youtube.com to authenticate their services.

Source: Blackweb Project

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest