made change back to old modal.

This commit is contained in:
dwebmm 2025-01-21 02:41:53 -06:00
parent 05c909787a
commit 66532191ac

View file

@ -276,19 +276,7 @@
title.includes("cannot") || title.includes("cannot") ||
title.includes("denied") title.includes("denied")
) { ) {
fumble(); // Show blocked content modal
return;
}
frame.focus();
try {
frame.contentWindow.focus();
} catch (e) {
// Ignore cross-origin errors
}
} catch (e) {
// Only show modal for mixed content errors
if (e.toString().includes("mixed active content")) {
const blockedModal = document.getElementById('blockedModal'); const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn'); const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn'); const openBtn = document.getElementById('blockedOpenBtn');
@ -307,14 +295,8 @@
}; };
return; return;
} }
// For other errors, just try another site } catch (e) {
fumble(); // Show blocked content modal for CORS errors too
}
};
// Also update error handler to check for mixed content
frame.onerror = (error) => {
if (error && error.toString().includes("mixed active content")) {
const blockedModal = document.getElementById('blockedModal'); const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn'); const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn'); const openBtn = document.getElementById('blockedOpenBtn');
@ -331,9 +313,35 @@
blockedModal.classList.remove('show'); blockedModal.classList.remove('show');
fumble(); fumble();
}; };
} else { return;
fumble(); // For other errors, just try another site
} }
frame.focus();
try {
frame.contentWindow.focus();
} catch (e) {
// Ignore cross-origin errors
}
};
// Also handle load errors
frame.onerror = () => {
const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn');
blockedModal.classList.add('show');
retryBtn.onclick = () => {
blockedModal.classList.remove('show');
fumble();
};
openBtn.onclick = () => {
window.open(frame.src, '_blank');
blockedModal.classList.remove('show');
fumble();
};
}; };
}; };