-
Notifications
You must be signed in to change notification settings - Fork 3.2k
How to mark a web site as trusted
- Back to Wiki home
- Back to Dashboard
- Back to Trusted sites pane
- Big power button
- Detailed syntax
- Disable filtering on YouTube channel
- Disabling filtering by default (blocklist mode)
- Other details
It serves to turn off blocking on the current website (will add current site to Trusted sites list), and its state will be remembered next time you visit the website.
uBO is enabled | uBO is disabled |
---|---|
All trusted site directives are matched against the URL address of web pages.
As of version uBlock Origin (uBO) 0.8.2.0, the trusted site directive syntax is split into three classes:
- Plain
- Complex
- Comment
Plain syntax is when using only hostname label(s), which means only the hostname portion of a URL will be taken into account. With plain syntax, the matching is performed by comparing the right-most portion of the page hostname with the trusted site directive. Wildcards are not allowed when using plain syntax.
Complex syntax occurs if and only if at least one /
appears in a trusted site directive. Optionally, the wildcard *
can be used with complex directives for more flexibility.
A comment is a line prefixed with #
. Comments are ignored by uBO.
If no /
appears in a trusted site directive, and if the directive contains characters which are not allowed for a plain hostname, then the trusted site directive will be commented out and ignored by uBO. This allows you to fix your directive.
Matches the domain and all subdomains:
-
example.org
: (i.e.example.org
,www.example.org
,forums.www.example.org
). -
www.example.org
: (i.e.www.example.org
,forums.www.example.org
, but notexample.org
). -
org
: (i.e.example.org
,wikipedia.org
,www.wikipedia.org
).
-
https://www.twitch.tv/letofski
: matches on only this one page, i.e. when the URL in the address bar matches exactlyhttps://www.twitch.tv/letofski
.
-
https://www.twitch.tv/letofski*
: matches on this one page, and everything underneath, i.e. when the URL in the address bar starts exactly withhttps://www.twitch.tv/letofski
.
*reddit.com/r/privacy/*
Wildcards can be used at any position. However, when a wildcard is used within the hostname portion of a directive, it cannot be at the end of the hostname, and also must be at the boundary of a hostname label.
/^https?://192\.168\.0\.\d+//
/^https://[0-9a-z-]+//
When you are facing a case where no other directive syntax work, you may use a regular expression ("regex") as a last resort solution. When a trusted site directive starts and ends with a forward slash (/
), uBO will treat the directive as a regex-based one.
Given that trusted site directives dictate where uBO should be completely disabled, be very careful with regex-based directives, you could easily mistakenly cause uBO to be disabled on more sites than you intended. Typically, only advanced users will resort to regex-based directives, and only for cases where no other syntax can do the job.
There are two ways to do this:
-
Kept updated, should be easy to use, point and click, with good description of usage.
-
Using one of the user scripts from Greasy Fork based on YouTube - whitelist channels in uBlock Origin.
Simple, with clearly visible code, but can be outdated. Someone posted instructions on Reddit, it was years ago, but explains few things: "Any way to whitelist certain youtube channels?".
Warning! These are third party tools, I can't vouch for them, you will have to find out for yourself whether they work.
(Aka "invert whitelist" in AdGuard: LINK) By design, on purpose, that is not a feature supported by uBO, at least not in a way that is too easy to achieve and handy to use. uBO is for people who share the view that the net is hostile by default and consequently uBO being disabled everywhere by default is incompatible with this view -- it would make no sense to have a malware list enabled by default just to have uBO disabled everywhere by default. AdGuard supports this mode easily & straightforwardly by a simple on/off button switching, so you may want to use AdGuard instead.
However, blocklist mode in uBO can be achieved manually, by specifically crafted Regular Expression trusted site directive:
/^((?!example\.com|different\.example\.net|another\.example\.org).)*$/
With this directive all domains separated by |
characters will be treated as blocklisted, and uBO will be enabled only on these pages.
There already exists a pile of duplicated requests to implement the feature. Requests to implement the feature to be identical as in AdGuard, were always declined and will not be accepted:
- (05.2016) Whitelist by default
- (11.2017) Option to enable/disable by default
- (05.2019) ublock is off by default and only the sites you specify will be blocked.
- (03.2021) Feature: invert the custom rules to a list "allowed to filter"
- (16.2024) Please add a fourth mode - "No filtering".
Hence there is no point in spamming the issue tracker by creating new duplicates over and over, discussion and sharing opinions should be continued in already existing threads, new threads will be labeled as invalid
or duplicate
and closed.
If you re-enable uBO by clicking the big power button in the popup while a trusted site directive you handcrafted is in effect, your handcrafted directive will simply be commented out. This way you can bring it back to life if ever you clicked the button by mistake.
uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
- Wiki home
- About the Wiki documentation
- Permissions
- Privacy policy
- Info:
- The toolbar icon
- The popup user interface
- The context menu
-
Dashboard
- Settings pane
- Filter lists pane
- My filters pane
- My rules pane
- Trusted sites pane
- Keyboard shortcuts
- The logger
- Element picker
- Element zapper
-
Blocking mode
- Very easy mode
- Easy mode (default)
- Medium mode (optimal for advanced users)
- Hard mode
- Nightmare mode
- Strict blocking
- Few words about re-design of uBO's user interface
- Reference answers to various topics seen in the wild
- Overview of uBlock's network filtering engine
- uBlock's blocking and protection effectiveness:
- uBlock's resource usage and efficiency:
- Memory footprint: what happens inside uBlock after installation
- uBlock vs. ABP: efficiency compared
- Counterpoint: Who cares about efficiency, I have 8 GB RAM and|or a quad core CPU
- Debunking "uBlock Origin is less efficient than Adguard" claims
- Myth: uBlock consumes over 80MB
- Myth: uBlock is just slightly less resource intensive than Adblock Plus
- Myth: uBlock consumes several or several dozen GB of RAM
- Various videos showing side by side comparison of the load speed of complex sites
- Own memory usage: benchmarks over time
- Contributed memory usage: benchmarks over time
- Can uBO crash a browser?
- Tools, tests
- Deploying uBlock Origin
- Proposal for integration/unit testing
- uBlock Origin Core (Node.js):
- Troubleshooting:
- Good external guides:
- Scientific papers