13

I have a server-side rendered Angular application in which I'm using ng2-adsense to display AdSense ads on certain routes. I've noticed that most of the time (not all of the time), my ads don't display and I get warnings in the Chrome Dev Console saying:

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://www.google.com/ads/measurement/l?ebcid=REDACTED with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
(anonymous) @ ads:1
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://googleads4.g.doubleclick.net/pcs/view?xai=REDACTED &sig=REDACTED &urlfix=1&adurl= with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://pagead2.googlesyndication.com/pagead/gen_204?id=sodar&v=24&t=2&bgai=REDACTED&bg=REDACTED with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.

I'm assuming that this is because my AdSense units are loaded dynamically (they have to be, the ads are only displayed on the client-side render) as opposed to on page load.

The linked documentation for CORB references a vague algorithm that determines what resource loads are safe. How can I prevent CORB from blocking my ads?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Jack Guy
  • 8,346
  • 8
  • 55
  • 86

1 Answers1

-1

Do you have a repro URL?

How is the content actually being retrieved? If you're using XHR or a similar request object, the responses must have an Access-Control-Allow-Origin header listing your origin, or *. Otherwise, they're blocked by the browser process (because the renderer doesn't have a way to read them due to Same Origin Policy anyway).

EricLaw
  • 56,563
  • 7
  • 151
  • 196