Spaces:
Running
Running
Fix VTVGO popup - fallback to new window if iframe blocked
Browse files- static/yt_live.js +2 -12
static/yt_live.js
CHANGED
|
@@ -843,20 +843,10 @@
|
|
| 843 |
if (loader) loader.style.display = 'none';
|
| 844 |
};
|
| 845 |
iframe.onerror = () => {
|
| 846 |
-
|
| 847 |
-
|
| 848 |
};
|
| 849 |
|
| 850 |
-
// Check if iframe is blocked by X-Frame-Options (detect after timeout)
|
| 851 |
-
setTimeout(() => {
|
| 852 |
-
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
| 853 |
-
if (!iframeDoc || iframeDoc.body.childElementCount === 0) {
|
| 854 |
-
// Fallback: open in new window
|
| 855 |
-
window.open(popupUrl, '_blank');
|
| 856 |
-
closeVtvPopup();
|
| 857 |
-
}
|
| 858 |
-
}, 3000);
|
| 859 |
-
|
| 860 |
frame.appendChild(iframe);
|
| 861 |
popup.classList.add('show');
|
| 862 |
}
|
|
|
|
| 843 |
if (loader) loader.style.display = 'none';
|
| 844 |
};
|
| 845 |
iframe.onerror = () => {
|
| 846 |
+
window.open(popupUrl, '_blank');
|
| 847 |
+
closeVtvPopup();
|
| 848 |
};
|
| 849 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 850 |
frame.appendChild(iframe);
|
| 851 |
popup.classList.add('show');
|
| 852 |
}
|