Focus now goes to iframe with every fumble

This commit is contained in:
Michael Andrew Maurakis 2025-01-19 23:05:49 -06:00
parent 8390bad5dd
commit dca71f4729

View file

@ -50,6 +50,17 @@
const frame = document.getElementById('contentFrame');
// Open wiby.me/surprise directly in the iframe
frame.src = 'https://wiby.me/surprise/';
// Wait for the page to load then focus
frame.onload = () => {
frame.focus();
// Try to focus the iframe content window if possible
try {
frame.contentWindow.focus();
} catch (e) {
// Ignore cross-origin errors
}
};
});
// Dark mode toggle