From dca71f472993e9d358ed9899907db9c7de5d3b43 Mon Sep 17 00:00:00 2001 From: Michael Maurakis Date: Sun, 19 Jan 2025 23:05:49 -0600 Subject: [PATCH] Focus now goes to iframe with every fumble --- index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.html b/index.html index 3bb460b..c5ba66d 100644 --- a/index.html +++ b/index.html @@ -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