From 044eac2f3d1e5c6de7b39d148c4b94ecf71313ef Mon Sep 17 00:00:00 2001 From: yellows8 Date: Mon, 15 Jun 2020 15:40:05 -0400 Subject: [PATCH] web: Updated for 10.x. --- nx/include/switch/applets/web.h | 1 + nx/source/applets/web.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nx/include/switch/applets/web.h b/nx/include/switch/applets/web.h index e93f5ba8..28022a80 100644 --- a/nx/include/switch/applets/web.h +++ b/nx/include/switch/applets/web.h @@ -28,6 +28,7 @@ typedef enum { WebExitReason_Requested = 0x2, ///< The applet exited since \ref webConfigRequestExit was used. WebExitReason_LastUrl = 0x3, ///< The applet exited due to LastUrl handling, see \ref webReplyGetLastUrl. WebExitReason_ErrorDialog = 0x7, ///< The applet exited after displaying an error dialog. + WebExitReason_UnknownE = 0xE, ///< Unknown } WebExitReason; /// Button values for \ref webConfigSetBootFooterButtonVisible. diff --git a/nx/source/applets/web.c b/nx/source/applets/web.c index 20cc17c4..90289e1b 100644 --- a/nx/source/applets/web.c +++ b/nx/source/applets/web.c @@ -692,6 +692,7 @@ Result webConfigSetMediaPlayerUi(WebCommonConfig* config, bool flag) { } Result webConfigShow(WebCommonConfig* config, WebCommonReply *out) { + Result rc=0; void* reply = NULL; size_t size = 0; WebShimKind shimKind = _webGetShimKind(config); @@ -715,7 +716,13 @@ Result webConfigShow(WebCommonConfig* config, WebCommonReply *out) { } } - return _webShow(&config->holder, config->appletid, config->version, &config->arg, sizeof(config->arg), reply, size); + rc = _webShow(&config->holder, config->appletid, config->version, &config->arg, sizeof(config->arg), reply, size); + if (R_SUCCEEDED(rc) && hosversionAtLeast(10,0,0) && (shimKind == WebShimKind_Web || shimKind == WebShimKind_Offline)) { + WebExitReason reason; + rc = webReplyGetExitReason(out, &reason); + if (R_SUCCEEDED(rc) && reason == WebExitReason_UnknownE) rc = MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen); + } + return rc; } Result webConfigRequestExit(WebCommonConfig* config) {