Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube integration throws XMLHttpRequest CORS policy errors #184

Open
RickR2H opened this issue Dec 16, 2020 · 6 comments
Open

YouTube integration throws XMLHttpRequest CORS policy errors #184

RickR2H opened this issue Dec 16, 2020 · 6 comments

Comments

@RickR2H
Copy link

RickR2H commented Dec 16, 2020

The YouTube video is loaded but there are console errors.

Issue description:

Chrome Console Errors:

Access to XMLHttpRequest at 'https://googleads.g.doubleclick.net/pagead/id' from origin 'https://www.youtube-nocookie.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Failed to load resource: net::ERR_FAILED

Version used:

Version : 1.12.5 via CDN

Code to reproduce the issue (HTML blocks + JavaScript initialization)

This is the default example integration via data-attributes

<!-- Background YouTube Parallax -->
<div class="jarallax" data-jarallax-video="https://www.youtube.com/watch?v=ab0TSkLe-E0">
    Your content here...
</div>

I hope you can help...

@nk-o
Copy link
Owner

nk-o commented Dec 18, 2020

Hey. We changed the Youtube URL to youtube-nocookie.com for GDPR compliance. And looks like it is conflicting with google ads.

I think you will need to use the 1.12.4 Jarallax version to prevent such errors.

@RickR2H
Copy link
Author

RickR2H commented Dec 24, 2020

@nk-o Thanks for the feedback! I'll try that first.

@plusorminus8
Copy link

I'm seeing the same error and have Jarallax version 1.0.1 on my site (which I know should be upgraded; it came with my Bootstrap theme).

It also seems to happen for the YouTube section of the Jarallax demo site: https://free.nkdev.info/jarallax/

Any ideas on how to fix?

@joeybab3
Copy link

Can confirm I'm also seeing this on 1.12.2 and 1.12.4

@joeybab3
Copy link

For context, it appears youtube has broken a lot of embed codes so that might be related?

@kbrmani
Copy link

kbrmani commented Nov 14, 2023

I am facing same problem but my website on Wordpress actually when, I am using Youtube video in my post then the error Show on Google search console "Access to XMLHttpRequest at 'https://googleads.g.doubleclick.net/pagead/id' from origin 'https://www.youtube.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants