deCODE - Our Newsletter for Jan 2022 is available for Download. 🗞   🥳
  Signup/Sign In
Written By:
Amundra
5 minute read
uBlockOriginAdblocker

Block Unwanted Content Using uBlock Origin

Posted in General   SEPTEMBER 16, 2021

ublock Origin

The advertisements we keep seeing on the internet all the time could be a serious pain. There are some ads that end up linking themselves to some malware, this is called malvertising. These ads become the barrier that doesn’t let you access the content you wanted to view, with ease. Also, the advertisements are also downloaded by your device thus pushing up your daily data usage which can be a problem if you are using a limited data plan.

The solution to all these problems is an ad-blocker. Ad-blockers are added to the browser to hide ads, they apply the community-generated filter list, and ads are blocked.

As these filter lists are not perfect, you can always get an ad once in a while but ad-blockers like uBlock Origin will allow you to manually block ads that coincidentally appear.

uBlock Origin

uBlock Origin is an ad-blocker that is free and available for all the major browsers. You can also find an element picker in this tool that removes custom elements.

If you have some knowledge of CSS or Xpath, it will be helpful to you while going through this article, but it isn’t mandatory.

uBlock Origin will provide you with the visual tools which you can use to select elements without having any technical knowledge.

What Are The Uses Of Blocking Elements

Uses of blocking elements uBlock Origin

There are a number of occasions when the information that we are consuming through the internet just isn’t relevant.

If there are a few websites that you visit quite randomly, filtering out the data that you won’t need could be quite a big boost to your productivity

  • Certain types of events can be removed from activity or social media feeds.

  • The popups that insist on doing things that you don’t want to can be removed.

  • Certain posts on YouTube or other social media by specific authors can be removed

  • Dynamic elements that might distract you could be removed.

Filtering HTML Elements

Filtering HTML elements

You can click on the uBlock Origin icon at the top of your browser and click on the element picker, with the eye drop icon, to filter elements.

As you click the icon on your browser’s toolbar, the uBlock Origin interface appears. Then you can start selecting the content that you want to remove. Even you don’t select perfectly, it is a starting point.

You can use the visual tools with the “Pick” button and sliders once the box appears at the bottom of the screen, or you can manually specify a selector.

Once you select the “Create” button, the content that is highlighted in red will be removed. If you visit the page at a later date or just refresh the page, these changes will still remain. Let’s find out how this works.

CSS Selectors

Most of the elements that you want to remove can be removed using the CSS selectors easily. Especially the static content of the page.

XPath

XPath is mainly used for one of the two reasons:

  • When you have to check against the value of an element.

  • When an element has to be selected based on the attributes of its children.

It is mainly beneficial in removing user-generated or dynamic content.

Removing Filters

Removing Filters uBlock Origin

You might need to access the website again sometime or it could be that the site has changed, in both cases you will have to remove the old filter.

For removing the custom filter:

Step 1: First, go to the settings of uBlock Origin.

Step 2: Click on the "My filters" tab.

Step 3: Delete the lines with the filter(s) you want to be removed.

Step 4: Click on "Apply changes" at the top.

Step 5: Then, refresh the page.


IF YOU LIKE IT, THEN SHARE IT

RELATED POSTS