4

I am getting a plethora of "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT" on embedded YouTube videos. The errors are caused by the AdBlock Chrome extension. Due to the errors the entire page takes seconds to resolve, vs under a second without the AdBlock. This creates a terrible user experience, and most users won't even realize that AdBlock is the cause.

The embedded iframe looks like the following:

<iframe width="560" height="315" src="https://www.youtube.com/embed/XXXXYYYY" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Complicating factors:

  • I am not the owner of the videos and cannot control the ad settings
  • I do not control the HTML that YouTube generates
  • I cannot ask users to disable AdBlock

Is there anything I can do on the developer side to make sure my page loads properly for users with AdBlock enabled?

Note that this question is related to Getting "net::ERR_BLOCKED_BY_CLIENT" error on some AJAX calls but is more specific to embedding iframes that you do not have direct control over

DivineOps
  • 1,656
  • 16
  • 17
  • 3
    Instead of using YouTube iframe player directly, which is terribly slow, consider using a library that only displays the thumbnail and loads the player only when clicked. There are several such libraries. – wOxxOm Jun 08 '18 at 07:11

0 Answers0