Good day, dear Habrovchane!
Many have known this for a long time, and many have not yet. This is about how, in Opera, what is called - from-the-box, to
correctly configure ad blocking, and also to disable google ad-sense and yandex direct scripts.
Disclaimer: since there are both “google ad-sense” and “yandex direct” in Habré, and this article teaches how to turn them off - to spread it here, in some way, is immoral. Therefore, in order to correct this ethical mistake, I urge you to do the following - call the context menu on the habr-page in Opera, go to the “settings for the site” and remove the checkbox from the “block unwanted content” item. After all, on your favorite site there is nothing undesirable, do you agree? :)')
The bottom line:So, in the opera there is a built-in “banner cutter”, or rather, an inappropriate content blocker. At the basic level, it works like this - the user indicates with a mouse an objectionable banner, after which this banner is blocked. If there are several banners on the page loading from the same site, Opera can determine the common source and block it entirely. In this mode, this tool is rather poor, it often blocks a single graphic file, and after reloading the page, the banner remains, showing a different image.
To increase the efficiency of the ad-blocker, the user must click "block content", then the "settings" button that appears at the top. Thus, he gets access to the list of rules. The main possibility that the built-in filter provides is to use masks. For example, the line
xz.ru/ads * will block all elements from addresses beginning 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 purpose of writing this article is to point out a method that will allow you to squeeze all 100% efficiency out of the built-in adblocker. The fact is that often the URL from which the site loads ads is created as a result of the work of “advertising” js scripts, and you cannot find it directly 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 that time. But once the situation wanted to change - at the sight of a mountain of left-wing addresses, which Opera shows in the status bar during their loading. This strained first of all because with the use of GPRS-Internet, the lion's share of time is spent on creating each TCP connection, and when advertising is loaded, such connections are opened in dozens!
A quick look at the source code of the page did not give anything. Then I said to myself “I must!” And (just do not laugh, dear experts! I’m a complete ignoramus!) Put Opera Dragonfly. At random, sometimes ineffective, I learned to find the left sources and block them by mask. But to you, dear users, such perversions come to nothing.
On the side of the Opera there is a button with the image “+”. Click it, and in the list that appears, select the item "Information". You now have a tab in the sidebar that displays detailed information about the open page, including about all objects loaded on it and their addresses sorted by type. Based on these data, even with a cursory examination, it is easy to make rules for blocking. This is my
main military secret .
Details:In the context menu, the “Block content ...” item refers only to the site on which it was called. This means that only those rules will be displayed in the list by which it is on this site that something is filtered out.
To view and edit the full list of rules, you need to go to the "Tools" menu - "Advanced" - "Blocked content ...".
Sometimes (and sometimes very often) the rules are for some reason 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 a urlfilter in the search. My file is located in "C: \ Documents and Settings \ Admin \ Application Data \ Opera \ Opera 10.50 Beta \ urlfilter.ini". Its structure is very simple.
For example, here is what I have below the line [exclude]:
*google-analytics*
*pagead*
*googlesyndication*
*googleads*
*an.yandex*
*rs.mail.ru*
*banner*
This, of course, not all, and given just for example. This list blocks both scripts that collect information for targeted advertising from Yandex and Google, as well as targeted advertising itself. In addition, most ads are blocked from the mail.ru domain, 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 single character. That is, * r? .Mail.ru * will filter both
rs.mail.ru/img/blabla.gif and
r1.mail.ru/zxzxz/xz.jpg .
Afterword:Q: Why is this way to block ads? Why not ad-munchers and ad-blocks?
A: Because he:
- available out of the box, does not require downloading / installing add. Software, just Opera - enough.
- simple and understandable for most competent users
- has maximum performance (filter compiled to Opera)
Q: What other ways will the author advise in order to improve work on the Internet through Opera with minimal effort?
A: In addition to the above, the author uses a single script: block-external-scripts.js. It blocks the download of scripts from other domains (the main source of js advertising), handles the most popular exceptions, and makes it easy to "load up" mistakenly blocked scripts - just move the mouse to the lower right corner of the open page and click on the removed "N scripts blocked" sign. This action disables block-external-scripts.js for the site on which it was made. You can take it here:
ruzanow.ru/userjs/block-external-scripts.jsTo install, you need to create a folder for it, for example, in the Opera catalog, copy the script itself there, and then specify the folder in “Tools” - “Settings” - “Advanced” - “Content” - “Customize javascript” - “Folder of user JavaScript files And restart the browser.
update: if necessary, to force to open some site that is blocked by a wider mask in urlfilter.ini, you must add a rule for this site in the [include] section, remove the asterisk from there, and set prioritize excludelist = 0. The urlfilter.ini file should look something like this:
[prefs]
prioritize excludelist=0
[include]
*example.com*
update: after receiving the first batch of comments, I decided to clarify.
The objectives of the article did not include:
- tell about all possible ways to block advertising
- tell about blocking all ads
- talk about cutting out advertising while maintaining “beautiful” page markup
The objectives of the article included:
- tell about this method to those who still do not know (yes, there are such, I myself was like this 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 capabilities
- give maximum control over the process (as opposed to "everything has already been done for us, download and use")
Clean and safe surfing you!