justinribeiro / lite-youtube

The fastest little YouTube web component on this side of the internet. The shadow dom web component version of Paul's lite-youtube-embed.
https://www.npmjs.com/package/@justinribeiro/lite-youtube
MIT License
836 stars 63 forks source link

Adjust warmConnections if using nocookie attribute, add profile image domain #101

Open mrwweb opened 7 months ago

mrwweb commented 7 months ago

From what I can see, it seems that the warmConnections() function will preconnect to all of these domains regardless of the nocookie attribute:

Looking at a request to youtube-nocookie.com, I think the only connections that should preconnect should be:

Looking at an embed request, I'm also seeing that YouTube profile icons are loaded from https://yt3.ggpht.com, so that would be a good one to add to both preconnect lists.

I'm willing to take a stab at a PR if you agree and think this makes sense.

XhmikosR commented 3 months ago

@mrwweb I totally agree with your OP. Could you please make a PR?

@justinribeiro: @mrwweb is right in his observations :)

justinribeiro commented 3 months ago

I concur; I'll either take a PR for this or I'll put it on the list this week.