Focus now goes to iframe with every fumble
This commit is contained in:
parent
8390bad5dd
commit
dca71f4729
1 changed files with 11 additions and 0 deletions
11
index.html
11
index.html
|
@ -50,6 +50,17 @@
|
||||||
const frame = document.getElementById('contentFrame');
|
const frame = document.getElementById('contentFrame');
|
||||||
// Open wiby.me/surprise directly in the iframe
|
// Open wiby.me/surprise directly in the iframe
|
||||||
frame.src = 'https://wiby.me/surprise/';
|
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
|
// Dark mode toggle
|
||||||
|
|
Loading…
Reference in a new issue