Support » Plugin: Pre* Party Resource Hints » No ‘Access-Control-Allow-Origin’ header is present on the requested resource

  • Resolved Bluemad

    (@bluemad)


    Hi,

    I try to preload Google Adsense script. Then I can see that following error in Google Chrome and prevent the following code loading. I have enabled “Crossorigin” and selected as “script”.

    Used script URL: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js

    Access to script at 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js' from origin 'https://www.mysite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    How do I correct this eror?

Viewing 1 replies (of 1 total)
  • Plugin Author Sam Perrow

    (@samperrow)

    Don’t use crossorigin on that request, and you should be good. I just tested it on my site and got the same error, and removing the crossorigin resolves it.
    No need to use that attribute in this situation. Crossorigin’s are generally only used for preconnecting fonts.

Viewing 1 replies (of 1 total)
  • The topic ‘No ‘Access-Control-Allow-Origin’ header is present on the requested resource’ is closed to new replies.