Skip to content Skip to sidebar Skip to footer

Is It Possible To Catch Net::err_blocked_by_client?

So on our site we have various searches some of which work fine and return the appropriate results. A few of them however return the javascript error: Failed to load resource: net

Solution 1:

Unfortunately you cannot catch that error message specifically, but you can catch the error itself:

$.ajax({
  url: 'http://openx.net',
  dataType: 'json',
  success: function( data ) {
    console.log( "Success:", data);
  },
  error: function( data ) {
    console.log( "Error:", data);
  }
});

Chrome blocking ad call

Obviously the example isn't requesting JSON, but you can see that it fails and calls the error handler.

These errors are fired by Chrome when, for instance, a plugin like Adblock (as you mentioned) cancels a request.

Solution 2:

If you have any Ad Blockers, disable them for the URL.

Post a Comment for "Is It Possible To Catch Net::err_blocked_by_client?"