Effective use of the built-in ad blocker in Opera

    Good day, dear Khabrovchians!

    Many have known this for a long time, and many have not. We are talking about how in the Opera browser, what is called “from-the-box,” correctly configure ad blocking, as well as disable google ad-sense and yandex direct scripts that “follow” the user.


    Disclaimer: since both google ad-sense and yandex direct are present on the hub, and this article teaches how to turn them off - it’s immoral to post it here, in a way. Therefore, in order to correct this ethical oversight, I urge you to do the following - call the context menu on the Habra page in Opera, go to "site settings" and uncheck the "block unwanted content" checkbox. After all, there is nothing unwanted on your favorite site, agree? :)

    The bottom line:
    So, the opera has a built-in “banner cutter”, or rather, a blocker of inappropriate content. At a basic level, it works like this - the user uses the mouse to indicate a banner unfavorable to him, after which this banner is blocked. If there are several banners loaded from one site on the page, Opera can determine the common source and block it entirely. In this mode, this tool is pretty wretched, it often blocks one single image file, and after reloading the page, the banner remains showing another image.

    To increase the efficiency of the ad-blocker, the user must click "block content", after which the "settings" button that appears at the top. Thus, he gets access to the list of rules. The main feature that the built-in filter provides is to use masks. For example, the line xz.ru/ads * will block all elements from addresses starting with the specified line. This allows, taking as a basis one blocked banner, on its basis to create a rule that cuts off the entire server with advertising.

    Actually, the goal of this article is to point out a way that will allow you to squeeze all 100% efficiency out of the built-in ad blocker. The fact is that often the URL from where the site loads ads is created as a result of the work of “advertising” js-scripts, and it cannot be found in plain text even in the source code of the page. But to add a rule for the filter, the user must somehow determine this address! I think many people stop here, as I stopped at one time. But once I wanted to change the situation - at the sight of a mountain of left addresses, which Opera shows in the status bar during their loading. This was annoying, first of all, because when using GPRS Internet, the lion's share of the time is spent on creating each TCP connection, and when loading ads, such connections are often opened in dozens!

    A quick look at the source code of the page yielded nothing. Then I said to myself "It is necessary!" And (just do not laugh, dear experts! I am a complete layman in this!) I installed Opera Dragonfly. Using the poke method, sometimes ineffective, I learned to find left sources and block them by mask. But to you, dear Habrauser users, such perversions are useless.

    On the side panel of the Opera there is a button with the image “+”. Click it, and in the list that appears, select the "Details" item. Now you have a tab in the sidebar that displays detailed information about the open page, incl. about all the objects loaded on it and their addresses, sorted by type. Based on these data, even with a quick inspection, it is easy to draw up rules for blocking. This is my main military secret .

    Details:
    In the context menu, the option “Block content ...” refers only to the site on which it is called. This means that only those rules will be displayed in the list according to which something is filtered on this site.

    To view and edit the full list of rules, go to the menu "Tools" - "Advanced" - "Blocked content ...".

    Sometimes (and sometimes - and very often) the rules for some reason are not added. That is, when manually editing and then pressing the "save" button, the changes are not saved. In this case, it is easy to manually edit the file with the rules. You can find its location by going to about: config and typing urlfilter in the search. My file is located in "C: \ Documents and Settings \ Admin \ Application Data \ Opera \ Opera 10.50 Beta \ urlfilter.ini". The structure is very simple.

    For example, here’s what’s below the [exclude] line:
    *google-analytics*
    *pagead*
    *googlesyndication*
    *googleads*
    *an.yandex*
    *rs.mail.ru*
    *banner*


    This, of course, is not all, and is given simply as an example. This list blocks both scripts collecting information for targeted advertising from Yandex and Google, as well as targeted advertising itself. In addition, most ads from the mail.ru domain are blocked, as well as objects that have the word banner in the URL.

    In addition to the "asterisk" symbol, you can use the "?" Sign to specify a mask - it means any one symbol. That is, * r? .Mail.ru * will filter both rs.mail.ru/img/blabla.gif and r1.mail.ru/zxzxz/xz.jpg .

    Afterword:
    Q: Why this particular way to block ads? Why not ad-muncher or ad-block?
    A: Because he:
    • available "out of the box", does not require downloading / installing add. Softa, just Opera - enough.
    • simple and understandable for most literate users
    • has maximum performance (filter compiled into Opera)

    Q: What other methods will the author advise in order to improve Internet browsing through Opera with minimal labor?
    A: In addition to the above, the author uses a single script: block-external-scripts.js. It blocks the loading of scripts from other domains (the main source of js advertising), handles the most popular exceptions, and allows you to easily “load” mistakenly blocked scripts - just move the mouse to the lower right corner of the open page and click on the “N N Scripts Blocked” message. This action disables block-external-scripts.js for the site on which it is produced. You can take it here: ruzanow.ru/userjs/block-external-scripts.js
    To install, you need to create a folder for it, for example, in the Opera directory, copy the script itself there, and then specify the folder in "Tools" - "Settings" - "Advanced" - "Content" - "Configure javascript" - "Folder of custom JavaScript files »And restart the browser.

    update: if necessary, force to open some site that is blocked by a wider mask in urlfilter.ini, you need to add a rule for this site in the [include] section, removing the "asterisk" from there and set prioritize excludelist = 0. The urlfilter.ini file should look something like this: update: after receiving the first batch of comments, I decided to clarify. The objectives of the article did not include:
    [prefs]
    prioritize excludelist=0

    [include]
    *example.com*





    • talk about all the possible ways to block ads
    • talk about blocking all ads
    • talk about cutting ads while maintaining the "beautiful" page layout

    The tasks of the article included:
    • to tell about the indicated method to those who are not yet in the know (yes, there are some, I myself was like that about a month ago, although I used the Opera for more than 3 years)
    • show how to get the most out of Opera’s built-in features
    • give maximum control over the process (as opposed to "everything has already been done for us, download and use")

    Clean and safe surf to you!

    Also popular now: