You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Reply to thread
document.addEventListener('DOMContentLoaded', function () {
// Check if the popup has been shown before
if (!localStorage.getItem('youtubePopupShown')) {
// Replace YOUR_VIDEO_ID with your actual YouTube video ID
var youtubeURL = 'https://www.youtube.com/watch?v=77WM3ujhvJ4';
// Open the YouTube video in a new popup window
var width = 560;
var height = 315;
var left = (screen.width / 2) - (width / 2);
var top = (screen.height / 2) - (height / 2);
window.open(youtubeURL, 'YouTubeVideo', `width=${width},height=${height},top=${top},left=${left}`);
// Set the flag in localStorage to indicate the popup has been shown
localStorage.setItem('youtubePopupShown', 'true');
}
});