diff options
author | jls47 <lukeschaefer@gmail.com> | 2021-07-17 16:10:15 -0700 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-07-27 11:31:11 -0400 |
commit | 3109d1c3db496e05558ddd836c63dbbc3dab1b98 (patch) | |
tree | 3cbff9442f111b101535f79d44edfa9f2e8dacd8 /src/yuzu/applets/qt_web_browser_scripts.h | |
parent | d6c799494c6235bc0796386bb31cae9fbe26f737 (diff) |
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
Diffstat (limited to 'src/yuzu/applets/qt_web_browser_scripts.h')
-rw-r--r-- | src/yuzu/applets/qt_web_browser_scripts.h | 6 |
1 files changed, 6 insertions, 0 deletions
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.", |