diff --git a/nx/include/switch/applets/web.h b/nx/include/switch/applets/web.h index 210e19db..fef8275c 100644 --- a/nx/include/switch/applets/web.h +++ b/nx/include/switch/applets/web.h @@ -227,6 +227,7 @@ typedef enum { WebArgType_SessionBootMode = 0x41, ///< [7.0.0+] u32 enum \ref WebSessionBootMode WebArgType_SessionFlag = 0x42, ///< [7.0.0+] u8 bool, enables using WebSession when set. WebArgType_MediaPlayerUi = 0x43, ///< [8.0.0+] u8 bool + WebArgType_TransferMemory = 0x44, ///< [11.0.0+] u8 bool } WebArgType; /// Types for \ref WebArgTLV, output storage. @@ -713,6 +714,14 @@ Result webConfigSetBootMode(WebCommonConfig* config, WebSessionBootMode mode); */ Result webConfigSetMediaPlayerUi(WebCommonConfig* config, bool flag); +/** + * @brief Sets whether TransferMemory is enabled. + * @note Only available with config created by \ref webPageCreate on [11.0.0+]. + * @param config WebCommonConfig object. + * @param flag Flag + */ +Result webConfigSetTransferMemory(WebCommonConfig* config, bool flag); + /** * @brief Launches the {web applet} with the specified config and waits for it to exit. * @param config WebCommonConfig object. diff --git a/nx/source/applets/web.c b/nx/source/applets/web.c index 0f38cb3c..c4f429df 100644 --- a/nx/source/applets/web.c +++ b/nx/source/applets/web.c @@ -702,6 +702,12 @@ Result webConfigSetMediaPlayerUi(WebCommonConfig* config, bool flag) { return _webConfigSetFlag(config, WebArgType_MediaPlayerUi, flag); } +Result webConfigSetTransferMemory(WebCommonConfig* config, bool flag) { + if (_webGetShimKind(config) != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + if (hosversionBefore(11,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + return _webConfigSetFlag(config, WebArgType_TransferMemory, flag); +} + static void _webConfigInitReply(WebCommonConfig* config, WebCommonReply *out, void** reply, size_t *reply_size) { if (out) { // ShareApplet on [3.0.0+] uses TLV storage for the reply, while older versions + everything else uses *ReturnValue.