CORS errors with youtube-nocookie

902 views
Skip to first unread message

Sean Fitzpatrick

unread,
May 7, 2022, 1:10:28 PM5/7/22
to PreTeXt development
I think this can be safely ignored, but making a note of it just in case:

If your book has YouTube videos and you choose the enhanced privacy option for embedding (using youtube-nocookie instead of youtube), you will see a whole bunch of CORS errors in the console.

These are beyond our control, I think -- they're caused by YouTube, not PreTeXt -- and don't seem to have any effect on the HTML functioning as expected. But I'm sure at some point, somebody is going to email me to complain that they don't like what they're seeing in the console.

Turning off privacy makes this go away. I've tested this using the embed code from YouTube in a basic HTML page to confirm that it's their embedding causing the problem.
It seems like YouTube is trying to inject ads from play.google.com, and is being blocked from doing so. (A feature, not a bug.)

The downside of turning off privacy: my YouTube channel doesn't have enough subscribers for me to monetize, but apparently it does have enough that YouTube is now running ads at the beginning of my videos. (As far as I know there is nothing I can do about this.) If you use standard YouTube embedding, you get rid of the CORS errors, but you now have ads running in your textbook that don't even generate revenue for you.

Rob Beezer

unread,
May 7, 2022, 1:31:19 PM5/7/22
to prete...@googlegroups.com
Thanks, Sean, for chasing this one down!

> somebody is going to email me to complain that they don't like what they're seeing in the console.

Get used to it. ;-)

Sean Fitzpatrick

unread,
May 9, 2022, 10:09:23 PM5/9/22
to PreTeXt development
I just learned something from a random teacher on Twitter: yout-ube.com is a shortcut for youtube-nocookie.com, and it defaults to full screen/embedded.

Unrelated to the CORS error, and I have no idea if it could ever be useful to us, but still, cool.


--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAwNy5iZWV6ZXI.1651944677%40quikprotect.

Sean Fitzpatrick

unread,
May 9, 2022, 10:17:32 PM5/9/22
to PreTeXt development
Ok, it's somebody's cute hack.

You enter the URL with the hyphen added, and some middleman website very quickly translates it to a URL using the nocookie address, and an embedded playlist consisting of a single video, as a way to bypass the ads.
Reply all
Reply to author
Forward
0 new messages