Skip to content

Commit

Permalink
Avoid cookies for YouTube embed (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 authored Jan 17, 2024
1 parent 32792bf commit d5450ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Inject the YouTube video
const iframe = document.createElement('iframe');
const videoId = link.href.match(/^https:\/\/(?:www\.youtube\.com\/watch\?v=|youtu\.be\/)(.+)$/)[1];
iframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1&rel=0`;
iframe.src = `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1&rel=0`;
iframe.frameborder = 0;
modal.appendChild(iframe);

Expand Down

0 comments on commit d5450ce

Please sign in to comment.