Jac*_*Guy 11 google-chrome adsense cors angular cross-origin-read-blocking
我有一个服务器端呈现的Angular应用程序,我在其中使用ng2-adsense在某些路由上显示AdSense广告.我注意到大部分时间(并非所有时间),我的广告都没有显示,我在Chrome开发者控制台中收到警告说:
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.
Run Code Online (Sandbox Code Playgroud)
我假设这是因为我的AdSense广告单元是动态加载的(必须是,广告只显示在客户端渲染上),而不是页面加载.
Eri*_*Law -1
你有重现网址吗?
内容实际上是如何被检索的?如果您使用 XHR 或类似的请求对象,则响应必须具有Access-Control-Allow-Origin列出您的来源的标头,或者*. 否则,它们会被浏览器进程阻止(因为无论如何,由于同源策略,渲染器无法读取它们)。