Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "net::ERR_BLOCKED_BY_CLIENT" error on some AJAX calls

Recently I've realised that, some adblocker extensions (such as adBlocker plus) block some Ajax calls. I get that error on the console:

GET http://localhost/prj/conn.php?q=users/list/ net::ERR_BLOCKED_BY_CLIENT  

Why does it block some Ajax call but not the others and what causes that? Is there any workaround other than telling user to turn off adblocker?

like image 339
s.alem Avatar asked Apr 28 '14 12:04

s.alem


People also ask

What does Net :: ERR_BLOCKED_BY_CLIENT mean?

This error is commonly caused due to one of the extensions installed within Chrome. Most likely you will see this error appear if you are using an extension such as Adblock or a browser safety plugin.

What does Failed to load resource net:: ERR_BLOCKED_BY_CLIENT mean?

It turns out when the network waterfall list this error, it means a browser extension blocked the request. The most common culprit is an ad blocker like AdBlock Plus. In short your requests to server have been blocked by an extension. Specifically AdBlock Plus was blocking my image.

How do I fix failed to load resources?

Chrome's cache clearing process, check all the options, and set the time range to “All time.” After you've cleared your cache, this might reset any options that were producing the error. Check the page in question to see if the resource is now displaying correctly. If not, you can also try resetting Chrome flags.


2 Answers

AdBlockers usually have some rules, i.e. they match the URIs against some type of expression (sometimes they also match the DOM against expressions, not that this matters in this case).

Having rules and expressions that just operate on a tiny bit of text (the URI) is prone to create some false-positives...

Besides instructing your users to disable their extensions (at least on your site) you can also get the extension and test which of the rules/expressions blocked your stuff, provided the extension provides enough details about that. Once you identified the culprit, you can either try to avoid triggering the rule by using different URIs, report the rule as incorrect or overly-broad to the team that created it, or both. Check the docs for a particular add-on on how to do that.

For example, AdBlock Plus has a Blockable items view that shows all blocked items on a page and the rules that triggered the block. And those items also including XHR requests.

Blockable items

like image 124
nmaier Avatar answered Sep 25 '22 22:09

nmaier


If your URL contains words such as "advert", "ad", "doubleclick", "click", or something similar…

For example:

  • GET googleads.g.doubleclick.net/pagead/id
  • static.doubleclick.net/instream/ad_status.js

…Then ad-blocker will block it.

like image 21
ShapCyber Avatar answered Sep 24 '22 22:09

ShapCyber