Attention adblock has blocked the loading of javascript files. Javascript Ad Block Detection AKA Adblock Plus


Adblock is a special extension program that hides advertising from the eyes of users. It comes as an addition to the search engine program, and its essence is to block pop-up windows, banners and other unwanted information that distracts from viewing the main content of the web page.

The Adblock extension is as easy to disable as it is to activate. Sometimes there is a need to display all the materials on the site, or the information is displayed incorrectly, and there is no need to block ads - in this article we will look in detail at how to disable Adblock in the most popular search engines - Google chrome, Yandex, Opera and Mozilla. We will also look at the features of connecting and disabling the Adblock program on phones, tablets and smartphones with software based on the Android OS.

How to disable adblock in Google Chrome

The Adblock extension is the most popular ad blocking add-on for web browsers. There are different versions of this program, the most recent of which block not only advertising messages, but also malicious links while browsing the Internet. In different search engines, the principle of disabling this program is quite uniform. Let's look at two ways to disable Adblock and Adblock plus (enhanced version) in the Google Chrome search engine.

First way
  • Open the browser.
  • In the upper right corner we find the Adblock program icon (in the example we will see two extensions - Adblock and Adblock plus, a more advanced version), click on it.


  • A menu window will open, select the “Pause program” option, click on it.


  • The Adblock program icon becomes inactive (green). To turn on the program, you should do the same operations as when turning it off.


Second way
  • Open the Google Chrome search engine, find the “Settings and Controls” icon in the upper right corner, click on it.


  • In the menu that opens, find the “Settings” option and go into it.


  • A window for internal browser settings will open; we don’t need them. In the upper left corner, click the “Extensions” tab.


  • After clicking it, a list of extensions will appear on the screen, select Adblock and Adblock Plus from the list, and uncheck the boxes next to these programs.


  • After clearing the checkboxes, the “Enabled” command will change to “Enable”.


Third way
  • Open the search engine, in the open window click the “Settings and Management” icon.


  • In the open menu, look for “Additional tools”, then “Extensions”, uncheck the boxes next to Adblock programs. Extensions are inactive.


How to disable adblock in Opera browser

It will take a couple of minutes to disable the ad blocking program in the Opera browser.

  • Open the search engine.
  • On the left side of the taskbar at the very bottom we find the extensions icon in the form of a puzzle piece.


  • Click on it, find active extensions (Adblock), give the command “Disable”. The extension is suspended in the Opera browser.



How to disable adblock in Yandex

The Yandex search program is very similar to Google Chrome, and the differences between them are very minor. Let's consider disabling Adblock in this search engine.

  • We go to the Yandex browser.


  • In the upper right corner we find the Adblock icon - usually it is an open palm on a red background, click on it.


  • An additional menu will open, perform the “Pause Adblock” operation.


  • After performing the “Pause Adblock” operation, the extension icon will change to “Class” on a green background - this means that the program is inactive.


Disabling adblock in Mozilla Firefox browser

The Mozilla search engine is becoming less and less popular compared to the more practical Google Chrome and Yandex, but many users still prefer this service as the most reliable and stable search engine. Let's consider disabling Adblock in this search engine.

  • Open the Mozilla browser.


  • In the upper right corner we find the already familiar program icon, click it.


  • The context menu appears, select “Disable everywhere”.


  • The Adblock extension is inactive, as indicated by the gray icon.


Adblock program in the Android operating system

Using Adblock on telephone devices, tablets and smartphones has its own characteristics. In Android, this extension comes as a separate web browser, with which you can search the Internet. At the same time, the program itself filters advertisements and malicious links; you only need to install this program yourself using the Google play service (Play Market).

If Adblock is installed on your device and you want to disable the ad blocking feature, you will need to do the following:

  • Open the Adblock browser on your phone (tablet, smartphone).

  • We go to the browser settings (this is done using the left key on a touch phone), find the “Options” menu, click on it.

  • In “Settings” we find the “Ad blocking” option, which will allow you to set the desired blocking parameters, language and default settings.

We looked at examples of disabling Adblock in four different browsers, as well as the features of disabling ad blocking in the Android operating system. The Adblock extension also allows you to disable blocking on individually viewed pages by first setting certain settings. This supplement has many analogues, as well as different versions, which differ in their target orientation and spectrum of action.

July 9, 2018

AdBlock is a major problem in the online advertising industry today. The number of users blocking advertising content is gradually growing, and the profits of website owners are decreasing. Numerous subscriptions allow extension owners to significantly increase the list of unwanted elements, adding to it not only advertising, but also, for example, social widgets installed on the page or statistics collection scripts, which seriously increases browsing privacy and complicates the involvement of visitors in the process of integrating the site with social networks. Sooner or later, developers are faced with the question: how to check for the presence of AdBlock and minimize the “damage” it causes?

How ad blockers work

From a technical point of view, AdBlock, uBlock Origin, AdGuard and other similar browser extensions (hereinafter referred to as AdBlock) do not block the advertising itself, but the corresponding network requests: when loading the page, each connection is checked against the list of prohibited ones and, if necessary, rejected. In the blockers themselves this is called surge protector. It can contain both a specific list of domains, for example, ad.mail.ru, and parts of the URL - /ucoz/img/uads/, which allows you to block requests even if they match the mask.

It happens that as a result of filtering, the site loses normal operation or the capabilities of the network filter alone are not enough to block unwanted content. To do this, blockers provide hiding elements - cosmetic filter, applied by embedding high-priority CSS rules into the document that hide areas with advertising, usually using the display property or in certain situations by adding the hidden attribute.

The uBlock Origin cosmetic filter works using the example of VKontakte advertising: the #ads_left element is forcibly hidden by built-in CSS with an impressively sized selector.

An exception to the rules is available for blocked or hidden content: if the user wishes, the extension can ignore unobtrusive (acceptable) advertising- banners, ads and links that are complementary to the main content, do not focus too much attention on themselves and in some cases are useful. Unfortunately, for ordinary sites it is virtually impossible to get into the white list, which means ad blocking is guaranteed by default.

But advertising is far from the only object of filtering. Blocking external resources or hiding elements depends on subscriptions, which are included in the custom AdBlock. Each subscription specializes in a specific type of objectionable content and is updated periodically.

Popular subscriptions

Undesirable content, on the basis of which filter lists for ad blockers are compiled, can be divided into groups. The list is not exhaustive, but covers the main filtering objects.

  • Advertising - any page elements, including externally connected resources, whose identifiers, classes and attributes contain expressions prohibited by the filter. Typically, the subscription is compiled with regional accounting, for example, EasyList+RuAdList.
  • Elements of social services - “share” buttons, social network widgets and other elements built in via API. The main list is .
  • “Annoying” elements are auxiliary page content: buttons for subscriptions, RSS, scrolling up; newsletter forms; blocks with warnings, information about the privacy policy and the use of cookies, etc. All this contains the Fanboy’s Annoyance List.
  • Statistics services - counters and traffic analysis scripts that track user behavior are not actually advertising, but are recommended for blocking in order to increase privacy. Among such lists, it is worth highlighting EasyPrivacy and the regional RuAdList Counters.
  • “Anti-AdBlock” elements are banners, modal windows and pop-up notifications that are displayed to users with enabled extensions and encourage them to disable the blocker and/or limit the functionality of the site. The answer to them are lists like Anti-AdBlock Filter.
  • Malicious and fraudulent content - sites that harm the computer and the user are blocked by all means: search engines, antiviruses, browsers. Extensions aimed at combating advertising also offer similar filters - for example, Malware Domains.
  • Custom blocking rules - the user can independently block a specific network request or hide an element on the page, which will be recorded in a separate filter.
  • Thus, the list of “candidates” for potential hiding or blocking increases significantly, and the question arises of how a developer can take this problem into account when designing a website.

    Layout taking into account AdBlock

    Periodically updated subscriptions with a huge number of blocking rules cannot be thoroughly analyzed, and on their basis it is impossible to create universal recipes for the correct layout of content that may be subject to filters. The best solution would be to install all kinds of subscriptions and check a specific site through the blocker logs. Below are general recommendations for the layout of the two types of most frequently encountered content - advertising and social widgets.

    Ad units

    Due to the fact that the cosmetic filter, similar to the network filter, also works by mask and checks the names of identifiers, classes and attributes of elements with those specified in the list, elements such as, for example, #adv, .ad-google, .banner125x125, .sponsor can be filtered regardless of the domain -logo , a and many others, therefore, in order to avoid layout distortions, such names are not recommended to be used to designate elements in HTML markup and to indicate the contents of the href , src attributes in links, pictures and frames: they will be hidden by default, even if the developer does not meant advertising content.

    To minimize the impact of cosmetic filters, you should ensure that content that could potentially be hidden has a parent container with an equivalent width and height, which is especially useful for relatively large ad units:

    Ads...

    Using this simple technique, when an element falls under the filter, an empty space appears in its place, which can be used, for example, to display a placeholder or from blocking rules.

    It is important that AdBlock also analyzes the attributes of elements, so it is recommended that links whose href contains an explicit indication of advertising should be replaced through URL shortening services, and the contents of the src attribute of images, if possible, should be converted to base64:

    Social widgets

    Almost all popular “social scripts” are blocked by both a cosmetic and network filter: the mentioned Fanboy's Social Blocking List subscription contains a significant number of class names and identifiers that are often used when laying out blocks that include social widgets: .b-share , .article__footer-share -title , .connect-icons and many others, as well as masks for external scripts, for example, /fbshare.js , /share42.js , /twitter.js .


    AdBlock is the reason for hiding not only advertisements, but also blocks with social buttons. The default cosmetic filter adds display: none to an element with class .article__share .

    To limit the effects of filters on such elements, developers should, whenever possible, abandon popular solutions in favor of their own scripts (an example of DIY) and be more selective in using names to indicate content in markup. The same applies to images used, as a rule, as social icons:

    Obviously, it is not always possible to “save” content from blocking, and the best thing to do in such a situation is to ask the user to exclude the site from AdBlock filters. To display a request, it is not necessary to use JS: it is enough to use simple CSS techniques, which will be discussed below. But first, it’s worth considering the issue of the content and location of the appeal on the page, since its main goal is not only to attract the visitor’s attention, but also to obtain consent.

    How to properly ask a user to disable AdBlock?

    To place notifications and requests (or links to them) to include a site in an exception from filtering, it is recommended to limit yourself to the space where advertising should have appeared, since being guided by the principle “turn off AdBlock or leave” and forcibly depriving you of the opportunity to normally use the site means guaranteed loss of loyalty visitors.

    When disabling AdBlock is an absolutely mandatory requirement, it demotivates and forces the visitor to look for other sites or, if it happens that he has no other options, to spend time bypassing this kind of blocking, manually hiding intrusive elements from the page.


    An example of the correct display of a request to disable AdBlock on Habré. The link to the appeal is unobtrusive and is placed strictly in the place of the advertising banner.

    The correct appeal (or link to it) should be unobtrusive, that is, not too focused on itself, but at the same time, be noticeable to the user. It is advisable to present convincing arguments in the text: for example, indicate the dependence of income from advertising and the costs of maintaining the site. Finally, the site itself should be useful and important to the user. It is high-quality content and the ability to give the visitor what he is looking for that are the main factors of audience loyalty. Therefore, when addressing the user, it is advisable to emphasize what exactly the site gives him in exchange for loyalty and what costs or efforts of developers are associated with the high-quality provision of this information, product, service.

    This can be illustrated by the example of a request from the mentioned IT community, even a small fragment of which reflects a respectful attitude towards the participants:

    As opposed to a tactful message that is placed on a specific part of the site and does not disturb the visitor, developers often use large modal windows with a fixed positioning that obscure the entire viewing area. This is not recommended for at least two reasons:

    • 1. A more or less experienced user, if desired, can easily hide with a cosmetic filter almost any element of the site that interferes with him, including such a modal window.
    • 2. This technique is harmful from an SEO point of view, as it can be considered by search robots as cloaking - an attempt to hide content.

    In conclusion to the question of correctly drafting a request, it should be emphasized that advertising itself should not be abused - AdBlock was originally intended as a response to annoying content. Huge blinking half-page banners located in the center of the screen will scare off even the most loyal users who decide to exclude the site from the filters.

    Displaying a request to disable AdBlock using CSS

    There are at least two simple options for implementing output messages asking you to disable AdBlock in pure CSS without using JavaScript: using the pseudo-class:empty and overlaying two elements on top of each other through the position and z-index properties. The first option is designed more for a surge filter, the second is more universal, as it potentially takes into account the effect of a cosmetic filter.

    Adding a pseudo element to a parent container

    If the script that generates advertising content and inserts it into a given empty block does not load due to a network filter, then this container will remain without child elements and the pseudo-class: empty will continue to apply for it. In a trivial execution this can be demonstrated as follows:

    Ads... .container:empty::before ( content: "Please disable AdBlock!"; )

    In the example, the external JS file inserts a new element into a block with the data-insert attribute. If the script fails to load due to a firewall, the .container element will be styled with the :empty pseudo-class:

    However, this method does not take into account the situation when the advertising script downloaded, generated and inserted the necessary elements into the desired container, but they were subsequently hidden by a cosmetic filter.

    Overlaying one block on top of another

    If the ad unit is not displayed due to a cosmetic filter, i.e. the element with an ad inside is forced to be hidden using display: none !important, then the:empty pseudo-class will become useless:

    Ads... Ads...

    To resolve the problem, it is proposed to create additional element, directly containing a message asking you to disable the blocker, but place it on a layer below, that is, position it under the ad unit so that it is visible only when the display: none rule has been applied to the visually overlapping element. To do this, you need to carry out simple manipulations with the position and z-index properties:

    Ads... Please disable AdBlock. .container ( position: relative; ) .adspace, .request ( position: absolute; width: 100%; height:100%; ) .adspace ( z-index: 2; /* the ad block is located on the layer “above” */ ) .request ( z-index: 1; )

    Unlike the previous case, when it was necessary to operate only with styles for pseudo-elements::before and::after , this approach expands the possibilities of styling and editing a notification, which is already a full-fledged DOM element, and therefore, by analogy with how it is implemented on Habré , in addition to plain text, you can add a button or link to a full message to the user in the block:

    JSFiddle is not accessible without JavaScript

    The only drawback of this technique is that an absolutely positioned .request element will be limited to the area of ​​its parent, so the specified code is unsuitable if there is a need to display a modal window in the center of the screen and a shadow that occupies the entire viewport. To solve this kind of problem, you cannot do without JavaScript.

    How to check for AdBlock via JS?

    The mechanisms of the network and cosmetic filters provide developers with the opportunity to determine the presence of AdBlock extensions using JavaScript: the loading state of a script connected to the page is monitored by the onload and onerror events or the ability to correctly call the methods and functions contained in it, and the visibility of the element is through the analysis of the CSS property applied to it display. Based on this, there are several ways to detect AdBlock.

    Using an external script

    The first option is to connect an external script to the page with a name suitable for the filtering mask and content, the execution of which will need to be checked. For example, a file called ads.js might contain just one variable:

    // ads.js var adb = "";

    Accordingly, if the ad blocker is enabled, the ads.js file will not load, and the adb variable declared inside it will not exist. Checking the execution of the script is a trivial condition that must be placed below the included file:

    If(typeof adb === "undefined") ( // AdBlock is enabled) else ( // AdBlock is disabled)

    The second option is similar to the first: the external ads.js script can be empty (but not return a 404 error), and the blocking check is to add onerror or onload events to it, which will be processed by a separate function with one parameter, for example, adsLoaded(status ):

    Var adsLoaded = function(status) ( if(status === false) ( // AdBlock is enabled ) else ( // AdBlock is disabled ) )

    In the HTML document, the connected script must have the appropriate handlers:

    The disadvantage of these methods is the creation of a separate file and an additional request to the server.

    Checking element visibility

    This approach does not involve creating external scripts or tracking their loading status: verification is carried out on a specific element by analyzing the CSS display property applied to it. Given the delay in initializing the ad blocker cosmetic filter, it is advisable to use the getComputedStyle() method and wait until the page and external resources have fully loaded to check the final calculated value:

    Window.addEventListener("load", function() ( if(window.getComputedStyle(document.getElementById("my-adv")).getPropertyValue("display") === "none") ( // AdBlock enabled ) else ( // AdBlock disabled ));

    This is the most optimal way to check whether not only advertising is blocked, but also any other content.

    Functions of advertising scripts

    Advertising scripts have their own methods and functions that cannot be called when the external file is unavailable. For example, Google Adsense creates a google_jobrunner object and embeds advertising through elements with the .adsbygoogle class:

    Document.addEventListener("load", function() ( if(typeof window.google_jobrunner === "undefined" || document.querySelector("ins.adsbygoogle").innerHTML.replace(/s/g, ""). length === 0) ( // AdBlock is enabled, Adsense script is blocked ) ));

    AdBlock check with subscription detection

    Having analyzed which elements are filtered by the blocker, we can make an assumption about the presence of the appropriate types of subscriptions for the user. Two factors influence the decrease in detection accuracy: the user list of filters and a large number of “official” subscriptions, the blocking rules of which often overlap.

    The essence of the check is to create “fake” elements on the page that are invisible to the user, but visible to AdBlock, with identifiers, classes and attributes indicating membership in a specific content group. Elements that fall under the cosmetic filter will indicate the presence of the corresponding type of subscription, i.e., in general, indicate what type of content is blocked by the user:

    To avoid littering the DOM with unnecessary garbage, elements should be removed immediately after verification.

    JSFiddle is not accessible without JavaScript

    As you can see from the example, the adbCheck() function returns an object, so if necessary, you can only access the property you are interested in:

    Var result = adbCheck(); result.ads_block; // advertising result.cnt_block; // counters result.soc_block; // social widgets result.ang_block; // annoying elements result.ant_block; // anti-adblock elements result.scm_block; // scam sites

    Finally

    Taking into account the actions of AdBlock filters is an indicator of the high-quality layout of the site and taking into account the segment of visitors who not only do not see advertising, but also, quite possibly, cannot use social share widgets and are not taken into account by visit counters and other statistical services. This is the wide range of filtering objects—from advertising scripts to social buttons and tracking elements—that popular subscriptions provide today. Checking for AdBlock should be given especially close attention on sites that depend on advertising revenue or actively use social widgets. In turn, a correct, tactful and unobtrusive approach to the visitor can seriously contribute to reconsidering his attitude towards blocked content.

    Pop-up messages with audio, animated ads and changing feeds on websites are annoying. Therefore, browser developers are taking measures to block unnecessary information, as are users. But sometimes it is impossible to work with the site if a plugin is installed in the web browser that prohibits the display of advertising. For example, resources for watching and downloading films and audio. Let's find out what needs to be done to disable the ad blocker in popular types of browsers.

    Instructions for Yandex.Browser The web browser has built-in blocking functionality and custom add-ons. To disable the browser ban itself, you need to go to the “Management” menu. It is called up by clicking on the toolbar at the top right - an icon of three horizontal stripes. From here you need to go to the “Settings” menu, then click the “Show additional…” button. Here, uncheck the box next to the item in the “Block shocking ads” list.

    If, when debugging the browser, the user made additional changes, namely installed special plugins, then they also need to be disabled. They do it like this:

    • Go to the “Management” menu;
    • Select “Advanced”;
    • In the new window, opposite all ad blockers, drag the slider towards “Off”;
    • Save changes.
    To confirm Yandex actions. It is better to restart the browser. Some applications may not take effect after saving changes normally. Instructions for Google Chrome users Google also suggests using its own and custom blocking functionality. Only this web browser has built-in security that works on a site-by-site basis. It's easy to disable it. You need to open the site on which you want to cancel ad protection in a browser tab. Then, on the left side of the address bar, find the padlock icon or the English letter “i” in a circle. Click on them and go to “Site Settings”. Here, select “Advertising” in the list of commands and select “Allow” mode in the menu on the right.


    If the user has installed a protection plugin, then to disable the blocker in the Google browser, you need to do the following:
    • Go to “Settings and Management” (ellipsis icon at the top right of the window);
    • Select “Additional tools”;
    • Click on “Extensions”;
    • Drag the slider to the Off position. or remove extensions that block advertising.



    After making changes to Google Chrome, the browser must be restarted. Especially if changes were made to the built-in functionality. Disabling Adblock in the Firefox web browser The browser itself only provides pop-up blocking. This feature is installed by default for every site opened in Mozilla Firefox. It's easy to turn off. You need to open a browser window, go to “Open menu” (the icon with stripes in the upper right corner) and select “Settings” from the list. In the window that appears, select “Privacy and Security” from the list on the left. Here, scroll down the list and find the “Permissions” item. Uncheck the box next to “Block pop-ups”.


    If the browser has manually installed plugins and extensions, then disable them like this:
    • Go to “Open menu”;
    • Select “Add-ons” from the list;
    • In the new window, from the list on the left, go to “Extensions”;
    • In the block in the center of the window, find all blockers and click “Disable”;
    • Restart Mozilla Firefox.


    Mozila, like Google Chrome, provides the user with the ability to install a large list of extensions that disable advertising. Therefore, you need to carefully review everything on the list. Instructions for working with the Opera browser Opera developers did things a little differently. The browser has a built-in powerful Ad-blocker and pop-up blocker, but it is not enabled by default. Therefore, if the user did not change the developer settings after installation, then the procedure for disabling the built-in functionality can be skipped. If edits have been made, then you can cancel them by going to “Settings and Controls” (Opera icon in the panel on the top left). Here select “Settings” and uncheck the first menu item.


    When installing extensions manually, cancel them as follows:
    • Go to “Settings and controls”;
    • Find and select “Extensions”;
    • From the new list, select “Extensions” again;
    • In the block that appears, click the “Disable” button under the add-on that prohibits advertising;
    • Restart Opera.


    All web browsers provide a function to disable and remove the plugin. If it disappoints - it skips pop-ups, does not remove all ads, etc., then you can delete it. Install a new extension instead. But if there are no complaints, it is better to perform a temporary shutdown so as not to repeat the installation procedure in the future.

    If you asked this question, it means that you are a fairly experienced user and know about the existence of such an add-on as Adblock, which hides almost all advertising from the eyes of users. It would seem like a useful plugin, so why disable it then? Undoubtedly, with its help you can get rid of colorful and intrusive banners, teasers, clickers and other types of advertising that distract from the main content of the site with their colors or sounds. However, some sites begin to display incorrectly, making it difficult to read articles, watch pictures or videos. That is why we decided to tell you how to disable the Adblock plugin in order to browse your favorite site normally.

    How to disable the Adblock plugin in Chrome

    To begin with, we suggest looking at the shutdown process in the most popular browser today - Google Chrome! Well, let’s not delay, let’s get straight to the point:

    1. Open the menu by clicking on the button on the right side (located at the very top);
    2. Click on “Settings”, after which a page with settings opens, but we don’t need it - we move on;
    3. Switch from settings to “Extensions”, after which a page with all add-ons opens;
    4. Uncheck the box next to “Enable”;
    5. Done! Now Adblock does not prevent your favorite site from displaying normally!

    How to disable the Adguard plugin in Yandex Browser

    In principle, everything in the Yandex browser is the same as in Chrome, because they have the same source code. But we will still explain:

    1. Click on the “Menu” button, which is located at the top right;
    2. A list appears where you need to click on the “Add-ons” section;
    3. A page with extensions opens. They are divided into categories;
    4. Scroll it to the very bottom and find the Adguard plugin (the same Adblock only specifically for Yandex Browser);
    5. Move the slider opposite it and the extension becomes inactive.

    Disabling the Adblock plugin in Mozilla Firefox

    As you have already noticed, the process of disabling the plugin is virtually the same in all browsers, only the names of the menu and the add-on itself have been changed (in the case of Ya. Browser), and Mozilla is no exception:

    1. Click on the same button to open the menu;
    2. Click on the icon under which there is the inscription “Add-ons”;
    3. The extension store opens. We don't need it - we pass by;
    4. In the menu on the left, click on “Extensions”;
    5. Actually, now the most interesting thing - we find Adblock among the plugins and click on the “Disable” button;

    How to disable the Adblock extension in the Opera browser

    And finally, let’s please people who use Opera as their main browser:

    1. Click on the “Opera” logo in the upper left corner and open the menu;
    2. Point the arrow at “Extensions” and go to “Extension Manager”;
    3. A page with installed plugins opens;
    4. Find our favorite Adblock among the add-ons and disable it by clicking on the “Disable” button;

    7 Answers


    Use my plugin "FuckAdBlock", it can detect AdBlock very easily: https://github.com/sitexw/FuckAdBlock

    FuckAdBlock.on(true, function() ( alert("AdBlock detected !"); )).on(false, function() ( alert("AdBlock is not detected =)"); ));

    javascript html

    2018-11-27T00:00Z

    If you want to show ads even when AdBlock is active, you will need to understand what AdBlock is capable of doing.

  • AdBlock may block resources while loading
  • AdBlock can hide certain elements in the DOM.
  • Although it is said that AdBlock can also modify CSS, I can't find any documentation on this other than hiding and collapsing elements.

    So what exactly could you do to be smarter than AdBlock?

    You can mask your request so that it is never "matched" (eg http://domain.com/ae9a70e0a.png, where the image name will be random each time and without a common prefix). As far as I know, a rule in AdBlock cannot contain a regular expression. The rule will not equal either ads or too many resources. You could rewrite such a URL on the server to point to your ad.

    However, while AdBlock won't be able to block your ad from loading, it will still be able to hide it. There is no real way around this. There will always be a clever CSS selector that will -just- select your element. However, you can add a background image with content. This is not useful for the ad (not clickable) but may help you display a different message. The downside is that if someone decides to block that annoying background image, they will also hide your content.

    As for the scenario, you can load the ad using an ajax request. I believe (but can't verify) that it will give an error if the resource cannot be loaded (because it was locked). ($.ajax(request).error(function() ( ... )); in jQuery or some equivalent in regular javascript). You can use this to do something else. You can include this in the document itself instead of an external resource to ensure it always works (as long as javascript is enabled). Even then, you can't be sure that "whatever you do" will never show up noticeably. As a last resort you can do window.alert(...) . Let's assume that within 3 pages your visitors will never return if you use this.

    Another way I can think of is to make a websocket on the server (afaik, this can't be blocked by AdBlock). On the server side, you will need to check if the ad pages are not loaded when a specific page is loaded. This information can be sent over a socket, which can be used in your script to do "something". This, however, seems crazy complicated and is a significant overhead for "just" a script that detects AdBlock.

    2018-12-11T00:00Z

    Function detect() ( //create a iframe. Append the iframe to the body. And then after 100ms check if their offsetHeight, display or visibility is set such a way that user cannot see them. //In the URL use the words specific to advertising so that Adblock can do string matching. var iframe = document.createElement("iframe"); iframe.height = "1px"; iframe.width = "1px"; iframe.id = "ads-text-iframe"; iframe.src = "http://domain.com/ads.html"; document.body.appendChild(iframe); setTimeout(function() ( var iframe = document.getElementById("ads-text-iframe"); if (iframe.style.display == "none" || iframe.style.display == "hidden" || iframe.style.visibility == "hidden" || iframe.offsetHeight == 0) ( alert("Adblock is blocking ads on this page"); iframe.remove(); ) else ( alert("Adblock is not detecting ads on this page"); iframe.remove(); ) ), 100); )

    2018-12-18T00:00Z

    In my case, ADB hid content even when there were no advertisements. (Simply because the ad word was present in many URLs because it was a post type pool).

    But I noticed that they don't remove the content by just applying mapping: none of them

    Since the additional solution

    I just noticed that using display: block! important; to the body, prevents Adblock plus from hiding content

    2018-12-25T00:00Z

    None of the tricks worked for me, maybe I was doing it wrong. but this is a very specific way of implementing Google advertising.

    Window.onload = function() ( if (document.getElementsByClassName("google-auto-placed").length == 0)( // Adblock Detected ) )

    If you plan to put this code in a separate .js file, make sure the file name does not contain the word "Ad" in it. just call it magic.js

    If Google ever decides to change the name of the div, this method will fail. but this seems unlikely.

    2019-01-01T00:00Z

    Of course it's an arms race and I support anyone's right to block ads, but I also support websites that depend on ad revenue trying to convince users otherwise or perhaps convince them to subscribe or donate to compensate lost ad revenue. I don't condone sites that try to force users to see ads, but a polite message is in order.

    Anyway, right now it's worth noting that there are many extensions/plugins for adblocking and they may have different ways of doing it and sometimes they differ between OS and browsers. I've found that for my purposes right now this jQuery selector is enough to at least see if AdBlock or AdBlockplus is being used, cross platform at least in Chrome and Firefox:

    If($("div iframe:visible").length == 0) ( // pop up a message or whatever )

    2019-01-08T00:00Z

    I know this is a bit old, but here is IMHO the best way to do it:
    Add this to the section:

    You can now use the ab-message identifier wherever you want to display a message to AdBlock users:

    Note that the inline style is added to hide it natively (of course you can also do this from your own CSS file).
    Also note that this takes 500ms, this is because it has to wait for the ad unit to do its job or it won't work.

    A little explanation of how this script works

    First, it adds an iframe with the source of the randomly generated link. (It is generated randomly because some ad units are smart, at some point they realize that the link is fake).
    It then performs several checks on that iframe (if it was loaded successfully or if its style was changed). If one of these tests is true, then it renders the ab-message element to adblock users.

    This script works for most (if not all) ad blockers.

    EXTRA

    Actually, it couldn't have just created the entity, but I created a Github project instead, but still, check it out and run it if it helps you.
    abDetector: A simple JavaScript Adwords detector.
    Enjoy.

    This latest article is written to cover the latest information about removing unnecessary links from Blogspot templates as well as new Blogger themes. As you know, there were changes in Blogger codes in 2018, so many actions with the code need to be done in a new way. Plus, new topics have appeared that are formed differently. In connection with these changes, we will discuss the topic of removing links.
    You can check your blog for the presence of external links on the services https://pr-cy.ru/link_extractor/ and https://seolik.ru/links. Don’t forget that you need to check not only the main page of the blog, but also the posts page and the Page. A large number of external links open for indexing are hampered.

    How to remove links from the old standard Blogger template Using the Simple template as an example.
    Such templates give the most external links. On my test blog, when I installed a simple theme, I checked that there were 25 external links on the main page, of which 14 were indexed.
    I remind you that before making changes to the template code, make a backup copy!
  • Remove link to Blogger - https://www.blogger.com/. This link is contained within the Attribution widget. In the “Blog Design” tab, it is displayed as the Attribution gadget and. To remove it, go to the “Theme” tab -> edit HTML. By searching for widgets (list of widgets), we find Attribution1 and delete all the code along with the footer section in which it is enclosed. This is what the removed code looks like collapsed:


    And here's the full code:











    Save the changes and check the blog for Attribution.
  • You, of course, have seen the “Wrench and Screwdriver” icons on your blog for quickly editing widgets. Each such icon carries with it an external link to Blogger. Now they are closed with the nofollow tag, but you still need to get rid of them. You will edit widgets in the Design tab.
    Here is an incomplete list of links that are encrypted in the wrench icons (the blog ID will be yours)
    - HTML1 Widget: http://www.blogger.com/rearrange?blogID=1490203873741752013&widgetType=HTML&widgetId=HTML1&action=editWidget§ionId=header
    - HTML2 widget http://www.blogger.com/rearrange?blogID=1490203873741752013&widgetType=HTML&widgetId=HTML2&action=editWidget§ionId=header
    - Blog archive: http://www.blogger.com/rearrange?blogID=1490203873741752013&widgetType=BlogArchive&widgetId=BlogArchive1&action=editWidget§ionId=main
    - Blog shortcuts: http://www.blogger.com/rearrange?blogID=1490203873741752013&widgetType=Label&widgetId=Label1&action=editWidget§ionId=main
    - Popular messages: http://www.blogger.com/rearrange?blogID=1490203873741752013&widgetType=PopularPosts&widgetId=PopularPosts2&action=editWidget§ionId=main
    It's easy to get rid of all these links. Find the tag in your blog template. It appears as many times as there are widgets on your blog. Remove all occurrences of the tag.
  • We remove links to quickly edit a blog entry (the “Pencil” icon). Makes it easier to edit posts, but poses a threat as an external link like: https://www.blogger.com/post-edit.g?blogID=1490203873741752013&postID=4979812525036427892&from=pencil
    How to delete:
    Method 1. In the Design tab, edit the “Blog Posts” element and uncheck the “Show “Quick Edit”” checkbox.
    Method 2. Find the tag in your blog template and remove it. Save your changes and check your blog for the icon and link.
  • Remove Navbar. Search for widgets in the blog html template Navbar1 and remove all the code along with the section.

    Namely:

    Now the Navbar on the blog does not provide indexable external links, but I believe that this is an extra element that does not carry a functional load, and it is better to remove it.
  • Remove external links to images. When you upload images to a blog post, a link is automatically embedded in the image. To remove such links, you must edit all blog entries. In the “View” mode and then on the “Link” icon. If the image does not contain an external link, then when you click on the photo in the post editor, the “Link” icon is not active (the icon is not highlighted).

  • Remove the link to the blog author's profile. Remove the author of the blog under the post. To do this, find the true code and write false instead of true. It will turn out false
  • Close the link from the “ ” widget from indexing with the nofollow tag. If you use the “profile” widget on your blog, then use a quick search for widgets in the blog template to find the code for the Profile1 gadget. You need to edit the widget code, replacing rel=’author’ with rel=’nofollow’ in two places and adding rel=’nofollow’ to two links. You should get something like the screenshot:


    Made using the example of editing a Google Plus profile. As a reminder, Google Plus will be discontinued on April 2, 2019. Accordingly, after this date, you will need to make other changes to the “About Me” widget code.

  • We check for the presence of external links any page of a Blogspot post on which comments have been left. Find and remove the code in the blog template:

    In Blog Settings, follow the path Blog Settings -> Other -> Site Feed -> Allow Blog Feed, apply the following settings:

  • Remove external links from the new standard Blogger template Using the Notable theme as an example
  • Remove Attribution (link below – Blogger Technologies)
    We find Attribution1 in the blog template for searching by widgets (list of widgets) and delete the code along with the section, similar to the old Blogger template (see above 1).
  • We remove the link from the “Report Abuse” widget. This is the ReportAbuse1 widget. We find in the search for widgets:
    The entire code looks like this:
  • We check the blog post page with comments and remove links by analogy with the old blog templates (see above - point 8).
  • We remove links from blog posts that are embedded in the pictures of posts (see point 5).
  • Ad blocking is a real problem for all bloggers and website owners whose only source of income is advertising placed on their own website. Let's take an objective look at ways to interact with visitors that block ads. Attention! The ethical aspect is not discussed in this article!

    1. Don't do anything

    This issue should not be viewed solely in black and white. Ad-blocking visitors use server resources and load the feed, but the site can benefit users in less obvious ways. For example, a visitor will give friends a link to your article, photo or video. These friends will visit the site and probably will not block ads. A visitor who blocks ads will leave a comment in the discussions, which is useful for the page from an SEO point of view (if it is relevant, of course). The comment may be useful to readers or the author of the article.

    In short, if you are an optimist. If all of the above applies to your resource, the best solution is to take no action. In the case of the site, I am guided by these very concepts and welcome any visitor, and advertising takes up less than 10% of the space from the content, I think this is tolerable.

    2. Ask not to block ads

    The site recognizes blocking through the use of “simulators” of advertising scripts (if the script is not executed, then the visitor is using programs like “adblock”). Politely and calmly explain that ad blocking prevents the site from loading completely harmless content. Ask the user to whitelist the site and the ad will load. This is a very elegant and effective way to solve the problem. When a user realizes that useful content is also hidden along with ads, he will likely make an exception for your site and add it to the white list.

    There are many anti-blocking plugins for the WordPress CMS that do their job perfectly and contain a lot of useful options.

    For example, you can configure the number of pages viewed before the user sees your request. The position of the message is indicated: at the top of the screen or in a pop-up window.

    On one of my sites I show users this message (see below). If you want, download this image for your website.

    I highly recommend seeing what the user you're asking to allow the ad to load will see. If the page looks much nicer without advertising, then it’s worth working on its design. Personally, I think being selective in how you choose to advertise is a big step forward and brings us to the next chapter.

    3. Work with trusted advertisers

    Advertising networks randomly pull ads from their huge library, and among them there are often frankly low-quality and unscrupulous ones, calling for downloading some dubious software, winning a free iPad or earning extra money. I am sure that website owners and developers should take a more responsible approach to the choice of advertising displayed on their own sites. Advertising is a necessity, which cannot be said about deliberate deception. Read the article about, don't focus on just one thing.

    4. Set up a redirect

    The most cruel way is to redirect users to another site, preventing them from viewing your site. to the page, indicating on it the reasons why the user does not deserve information on your site. Particularly vindictive webmasters prefer to redirect to a site with shocking content. This is, of course, the worst option proposed, since it is extremely annoying for visitors.

    In addition to the loss of income due to blocked advertising, there will be a dissatisfied visitor who could become a regular user. Some site owners are happy with this approach, since users who block ads do not have the right to watch content without giving anything in return. Especially if visitors are expected to do little more than click on an advertising banner and load some 90 kilobytes of a page.

    A special plugin for WordPress that would cope well with this task has not yet been developed. I wrote a small jQuery script to determine the size of the ad container after the page has loaded. If the container size is 0 pixels, then the ad did not load and was blocked. Before using the script, give the container a style id for CSS or place the advertising code in div tags, where you specify a specific id.

    Place this code on the page (such a page will not be validated for compliance with HTML code standards, with the exception of HTML5, but this snippet will not affect the operation of the site in any way).

    We will be happy to answer your questions and help you implement the described methods. Just let's stick to the technical side and not talk about moral aspects.

    Pop-up messages with audio, animated ads and changing feeds on websites are annoying. Therefore, browser developers are taking measures to block unnecessary information, as are users. But sometimes it is impossible to work with the site if a plugin is installed in the web browser that prohibits the display of advertising. For example, resources for watching and downloading films and audio. Let's find out what needs to be done to disable the ad blocker in popular types of browsers.

    Instructions for Yandex.Browser The web browser has built-in blocking functionality and custom add-ons. To disable the browser ban itself, you need to go to the “Management” menu. It is called up by clicking on the toolbar at the top right - an icon of three horizontal stripes. From here you need to go to the “Settings” menu, then click the “Show additional…” button. Here, uncheck the box next to the item in the “Block shocking ads” list.

    If, when debugging the browser, the user made additional changes, namely installed special plugins, then they also need to be disabled. They do it like this:
    • Go to the “Management” menu;
    • Select “Advanced”;
    • In the new window, opposite all ad blockers, drag the slider towards “Off”;
    • Save changes.


    To confirm Yandex actions. It is better to restart the browser. Some applications may not take effect after saving changes normally. Instructions for Google Chrome users Google also suggests using its own and custom blocking functionality. Only this web browser has built-in security that works on a site-by-site basis. It's easy to disable it. You need to open the site on which you want to cancel ad protection in a browser tab. Then, on the left side of the address bar, find the padlock icon or the English letter “i” in a circle. Click on them and go to “Site Settings”. Here, select “Advertising” in the list of commands and select “Allow” mode in the menu on the right.


    If the user has installed a protection plugin, then to disable the blocker in the Google browser, you need to do the following:
    • Go to “Settings and Management” (ellipsis icon at the top right of the window);
    • Select “Additional tools”;
    • Click on “Extensions”;
    • Drag the slider to the Off position. or remove extensions that block advertising.



    After making changes to Google Chrome, the browser must be restarted. Especially if changes were made to the built-in functionality. Disabling Adblock in the Firefox web browser The browser itself only provides pop-up blocking. This feature is installed by default for every site opened in Mozilla Firefox. It's easy to turn off. You need to open a browser window, go to “Open menu” (the icon with stripes in the upper right corner) and select “Settings” from the list. In the window that appears, select “Privacy and Security” from the list on the left. Here, scroll down the list and find the “Permissions” item. Uncheck the box next to “Block pop-ups”.


    If the browser has manually installed plugins and extensions, then disable them like this:
    • Go to “Open menu”;
    • Select “Add-ons” from the list;
    • In the new window, from the list on the left, go to “Extensions”;
    • In the block in the center of the window, find all blockers and click “Disable”;
    • Restart Mozilla Firefox.


    Mozila, like Google Chrome, provides the user with the ability to install a large list of extensions that disable advertising. Therefore, you need to carefully review everything on the list. Instructions for working with the Opera browser Opera developers did things a little differently. The browser has a built-in powerful Ad-blocker and pop-up blocker, but it is not enabled by default. Therefore, if the user did not change the developer settings after installation, then the procedure for disabling the built-in functionality can be skipped. If edits have been made, then you can cancel them by going to “Settings and Controls” (Opera icon in the panel on the top left). Here select “Settings” and uncheck the first menu item.


    When installing extensions manually, cancel them as follows:
    • Go to “Settings and controls”;
    • Find and select “Extensions”;
    • From the new list, select “Extensions” again;
    • In the block that appears, click the “Disable” button under the add-on that prohibits advertising;
    • Restart Opera.


    All web browsers provide a function to disable and remove the plugin. If it disappoints - it skips pop-ups, does not remove all ads, etc., then you can delete it. Install a new extension instead. But if there are no complaints, it is better to perform a temporary shutdown so as not to repeat the installation procedure in the future.




    

    2024 gtavrl.ru.