uBlock Origin is the most powerful and versatile ad blocker available. Unfortunately, the design is also a little obscure. This guide will explain the ins and outs of uBlock Origin’s advanced features, including adding custom lists, creating custom user filters, setting up dynamic blocking rules, and adjusting rules for uBlock Origin on specific domains with the advanced user interface.
Installing uBlock Origin
A pre-built version of the uBlock Origin extension is available for Google Chrome, Firefox, Safari, Microsoft Edge and Opera. You can also build the extension manually from source for Firefox and Chrome.
A quick warning: uBlock Origin is not and has never been connected to ublock.org or the uBlock extension. The Origin part in the name is very important in distinguishing between these two unrelated projects that once shared a similar codebase. ublock.org and the uBlock extension should be avoided, as they are imitators that purposefully confuse the market to steal data and deceive users. Be sure you have uBlock Origin and not uBlock.
Setting Up Advanced Options
Before we can do anything interesting with uBlock Origin, we need to enable advanced settings. Make sure to check out the required reading before you proceed. If you lack the troubleshooting experience to manage these types of decisions, consider reading up on how cookies work before you start tinkering with their functionality. Otherwise, expect the unexpected!
1. Click on the uBlock Origin extension’s icon.
2. Click the Settings icon.
3. Tick the box next to “I am an advanced user.”
Once you have advanced settings enabled, you can adjust blocking settings on a granular level.
Dynamic Filtering Rules
Filtering is handled in uBlock Origin at two levels: globally and locally. Global rules apply to all URLs, while local rules are for the current URL only.
The first column specifies the URL that the content originates from.
The second column indicates global settings, which are inherited by the specific URLs.
The third column indicates local rules for the current URL.
If you mouse over a box in the “global” or “local” rules column, you’ll see red, grey, and green thirds.
Click on the red third to set a blocking rule for the associated content type. The green third permits the corresponding element. The grey third sets a “noop” rule, which stands for “no operation.” This setting will prevent uBlock Origin from taking action on the associated content. Setting a “noop” filter will override global settings for a specific URL.
At the top of the window are content types. These can be blocked at the global and URL-specific level. These are blunt filters but useful nonetheless.
Under the content types are the URLs loaded on the current webpage. A plus icon indicates that content from that URL is being permitted. A minus icon indicates that content from the URL is being blocked. You can sometimes see a mixture of pluses and minuses for one URL, which indicates that some of the content is permitted while other content is blocked.
You can also look at the color coding next to the URL. Green indicates that content from that URL is permitted. Yellow indicates that some content from that URL is blocked. Red indicates that all content from the URL will be blocked.
Settings an inherited based on specificity. For example, global content type rules have the lowest priority. Rules set on filtering lists have a medium priority ranking: they can override global settings, but not URL-specific user settings. The highest priority is given to URL-specific local rules set by the user.
Saving and Reverting Filtering Rules
Changes you make to filtering rules are automatically reset the next time you visit a website. To make your settings permanent, click the lock icon.
To revert to the last saved state, click the eraser icon.
Third-Party Scripts and Frames
In general, it’s a good idea to block third-party scripts and frames by default. This protects both your privacy and your eyeballs. It can also break websites, so keep a quick finger on the “noop” override.
To block third-party scripts and frames, click the red third of the box next to each in the global column. This will automatically block all third-party scripts and frames on every URL.
If a website breaks, you can set a “noop” override to permit third-party scripts and frames. Click the grey box in the local rules column to set a “noop” rule and override the global blocking rule for this URL.
This noop rule will only apply to the current URL.
Alternatively, you can also hunt down the URL of the blocked resource and permit that resource specifically. This is easiest with the third-party frame has a clear origin, like a YouTube or Twitter embed. If you permit those frames globally and save the rule, those URL-specific filters will trump the global content type filters.
By balancing global and local filters with content type filters, you can set sensible online privacy settings while permitting content you don’t find as objectionable.
Viewing and Editing Dynamic Rules
To view the filters that you’ve already set, look at uBlock Origin’s Settings page under the My Rules tab. Here, you’ll see the rules you’ve set in two lists. The list on the left is for permanent rules and the list on the right is for temporary rules, as indicated by their headings.
The text contents of the right-most temporary rule column can be edited directly with the cursor, mouse, and keyboard. If uBlock Origin detects a difference between the two columns, you’ll see contextual buttons labeled “Revert” and “Commit” that offer the option to sync the columns with one another. Click “Revert” to copy the unchanged contents of the permanent rule list to the temporary rules list. Click “Commit” to copy the change from the temporary rules list to the permanent rules list.
You’ll notice that the text formatting of the rules follows specific conventions. The syntax is like so:
If you follow the dynamic filtering rules syntax guide on uBlock Origin’s GitHub page, you can change and set rules with text strings directly from this pane.
Removing Elements with Static Rules
If you want to remove elements from the page using graphical tools, you can access that feature by setting cosmetic rules. These rules remove DOM elements based on a graphically-based node selection by the user. If you see something on a website that bothers you, like a email subscription banner, an ad-block detector, or anything else offensive to your sensibilities, you can remove it this way.
Temporary Rules: Element Zapper
There are two different ways to set cosmetic rules in uBlock Origin. The first is with the Element Zapper, accessed through the lightning bolt icon on uBlock Origin’s extension dropdown pane.
This tool sets a temporary rule removing the specified DOM element. With the next browser session, the element will return. To create a rule, click the element zapper icon, and then click on the page element you want to remove. As you mouse over various DOM elements, they’ll be colored yellow to indicate what element is currently selected. Once the right element is selected, click to remove the selected element instantly. No confirmation box will appear after clicking
The element zapper will do its best to pick the element you’ve selected, but you might need to dance your mouse around a bit to get the element you’re hoping for. It will attempt to adhere to the largest DOM object that its algorithm can locate and select.
Permanent Rules: Element Picker
To set a permanent rule, use the Element Picker, represented by the eyedropper icon to the right of the lightning bolt.
This will activate an interface similar to the element zapper, but now DOM elements will be highlighted in red instead of yellow.
When you click on the red highlighted element, a text box will appear in the lower-right, previewing the class or ID of the selected element. It’s this text-based class or ID match that will be used to remove the element in the future. And since many sites obfuscate their code to make ad blocking more difficult, you may need to refine the element picker’s automatic selection from time to time. You can also use this tool to select “layers” of the DOM that are completely obscured or exist only in DOM logic.
To select a different element, mouse over its name in the yellow box below the white text box. Click on the text to see the associated element highlighted in red.
When the correct element is selected, click the “Create” button to create the rule and remove the element. You can also click the adjacent “Pick” button to return to the element picker if you selected the wrong part of the page.
In the future you can find the rule in uBlock Origin’s settings under the “My Filters” tab. New rules will appear at the bottom of the list with their data and timestamp.
If you want to ignore a rule, you can type an exclamation point at the beginning of the line to comment out the element rule. You can also see additional static filer syntax in uBlock Origin’s documentation on GitHub.
Finding and Using Custom Filter Lists
uBlock Origin comes with some preset filter lists, but there are many more you can add. The easiest way to add more filters is to browse FilterLists.
If you find a filter list you want to add to uBlock Origin’s filters, click “Details” and then “Subscribe.” This will automatically download and include the list in uBlock Origin’s blocking rules for websites visited in the future. Only lists with the uBlock Origin icon can be added to uBlock Origin in this way.
These filters will then appear under the “Filter Lists” tab in uBlock Origin’s options page. They can be viewed and toggled from that page in the future.
Storing and Syncing Rules
To make a local backup of your uBlock Origin rules, you can save your settings out to a file. Find the dialog options at the bottom of the main uBlock Origin settings tab.
If you want to use the browser-based cloud storage for extensions, you can tick the “Enable cloud storage” option on the main page of uBlock Origin’s settings. This will allow you to upload data within the extension’s small file space within the browser. This only syncs with other copies of the same browser, however.
If you upload your uBlock Origin settings in Firefox, you cannot then download them in Chrome on another computer. As a result, sharing configurations through files is the most reliable method of the time being. To sync your rules among multiple browsers and computers, you can share the backup configuration text file over a cloud storage service.
uBlock Origin isn’t exactly an ad blocker. It’s a wide-spectrum content blocker. That means it can control what comes into your browser no matter its origin. That makes it extremely powerful, and extremely easy to mess up. So take care with what you do, and if something breaks, be prepared to fix it.