From 3109d1c3db496e05558ddd836c63dbbc3dab1b98 Mon Sep 17 00:00:00 2001 From: jls47 Date: Sat, 17 Jul 2021 16:10:15 -0700 Subject: qt_web_browser: Focus on the first link element Focusing on the first link element fixes element navigation upon loading the web applet in games such as Super Mario Odyssey --- src/yuzu/applets/qt_web_browser_scripts.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/yuzu/applets/qt_web_browser_scripts.h') diff --git a/src/yuzu/applets/qt_web_browser_scripts.h b/src/yuzu/applets/qt_web_browser_scripts.h index 992837a85..c4ba8d40f 100644 --- a/src/yuzu/applets/qt_web_browser_scripts.h +++ b/src/yuzu/applets/qt_web_browser_scripts.h @@ -73,6 +73,12 @@ constexpr char LOAD_NX_FONT[] = R"( })(); )"; +constexpr char FOCUS_LINK_ELEMENT_SCRIPT[] = R"( +if (document.getElementsByTagName("a").length > 0) { + document.getElementsByTagName("a")[0].focus(); +} +)"; + constexpr char GAMEPAD_SCRIPT[] = R"( window.addEventListener("gamepadconnected", function(e) { console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.", -- cgit v1.2.3