From 48366b8dd50dae90e5d4071b77ec07886954159f Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 25 Jul 2021 13:35:58 +0200 Subject: [PATCH] early-access version 1912 --- README.md | 2 +- src/yuzu/applets/qt_web_browser.cpp | 3 --- src/yuzu/applets/qt_web_browser_scripts.h | 6 ++++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 470f7306d..bf53488c3 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1911. +This is the source code for early-access 1912. ## Legal Notice diff --git a/src/yuzu/applets/qt_web_browser.cpp b/src/yuzu/applets/qt_web_browser.cpp index 2415e375f..87e1750e4 100755 --- a/src/yuzu/applets/qt_web_browser.cpp +++ b/src/yuzu/applets/qt_web_browser.cpp @@ -370,9 +370,6 @@ void QtNXWebEngineView::LoadExtractedFonts() { void QtNXWebEngineView::FocusFirstLinkElement() { QWebEngineScript focus_link_element; - constexpr char FOCUS_LINK_ELEMENT_SCRIPT[] = - R"(if(document.getElementsByTagName("a").length > 0) document.getElementsByTagName("a")[0].focus();)"; - focus_link_element.setName(QStringLiteral("focus_link_element.js")); focus_link_element.setSourceCode(QString::fromStdString(FOCUS_LINK_ELEMENT_SCRIPT)); focus_link_element.setWorldId(QWebEngineScript::MainWorld); diff --git a/src/yuzu/applets/qt_web_browser_scripts.h b/src/yuzu/applets/qt_web_browser_scripts.h index 992837a85..c4ba8d40f 100755 --- 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.",