Michael Altfield's gravatar

Using uBlock Origin to Whitelist

As some mega websites deploy APIs that are used nearly ubiquitously on most of the Internet's websites (I'm looking at you Facebook & Google), I've begun to compartmentalize my browsers to "jail" specific website usage to a single, sandboxed browser (profile). This is sometimes referred to as a Site-Specific Browser (SSB).

Besides making sure that your SSB is isolated in that it cannot access your regular browser's data (a configuration I plan to document in the future), it's essential to block all network traffic from/to your SSB and all websites, except a whitelist. Unfortunately, getting block-all-then-whitelist functionality in uBlock Origin was annoyingly not documented, so I decided to publish it.

If you want uBlock Origin to block all traffic, add the following line to the textbox in your "My filters" tab of uBlock's Dashboard.


This will block all traffic to all sites that contain a dot (that is, all sites--domain or ip). Note that using the wildcard alone does not work!

Once that rule is in-place, you can whitelist each domain you wish to *not* block under the "Whitelist" tab of the uBlock Dashboard.

Note: If you're not using a proxy normally, the easiest way to achieve this block-everything-but-domains-in-my-whitelist functionality is to configure a dummy proxy: configure your browser to use a non-existent proxy at, say, on port '9001'. Then add the domains you do wish to visit into the CSV field titled "No proxy for". No addon needed! Enjoy 🙂

Related Posts

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>