Added webConfigSetScreenShot, and minor other web changes.

This commit is contained in:
yellows8 2019-02-28 22:15:18 -05:00
parent 4ef0dd09f0
commit 121f2cf868
2 changed files with 15 additions and 1 deletions

View File

@ -78,6 +78,7 @@ typedef enum {
WebArgType_UnknownD = 0xD, ///< [1.0.0+] u8 WebArgType_UnknownD = 0xD, ///< [1.0.0+] u8
WebArgType_UserID = 0xE, ///< [1.0.0+] u128 userID, controls which user-specific savedata to mount. WebArgType_UserID = 0xE, ///< [1.0.0+] u128 userID, controls which user-specific savedata to mount.
WebArgType_AlbumEntry = 0xF, ///< [1.0.0+] Share-applet caps AlbumEntry WebArgType_AlbumEntry = 0xF, ///< [1.0.0+] Share-applet caps AlbumEntry
WebArgType_ScreenShot = 0x10, ///< [1.0.0+] u8 bool
WebArgType_EcClientCert = 0x11, ///< [1.0.0+] u8 bool WebArgType_EcClientCert = 0x11, ///< [1.0.0+] u8 bool
WebArgType_Unknown12 = 0x12, ///< [1.0.0+] u8 WebArgType_Unknown12 = 0x12, ///< [1.0.0+] u8
WebArgType_PlayReport = 0x13, ///< [1.0.0+] u8 bool WebArgType_PlayReport = 0x13, ///< [1.0.0+] u8 bool
@ -209,6 +210,14 @@ Result webConfigSetWhitelist(WebCommonConfig* config, const char* whitelist);
*/ */
Result webConfigSetUserID(WebCommonConfig* config, u128 userID); Result webConfigSetUserID(WebCommonConfig* config, u128 userID);
/**
* @brief Sets the ScreenShot flag, which controls whether screen-shot capture is allowed.
* @note Only available with config created by \ref webPageCreate.
* @param config WebCommonConfig object.
* @param flag Flag
*/
Result webConfigSetScreenShot(WebCommonConfig* config, bool flag);
/** /**
* @brief Sets the EcClientCert flag. * @brief Sets the EcClientCert flag.
* @note Only available with config created by \ref webPageCreate or with Offline-applet. * @note Only available with config created by \ref webPageCreate or with Offline-applet.

View File

@ -251,10 +251,15 @@ Result webConfigSetUserID(WebCommonConfig* config, u128 userID) {
return _webTLVSet(config, WebArgType_UserID, &userID, sizeof(userID)); return _webTLVSet(config, WebArgType_UserID, &userID, sizeof(userID));
} }
Result webConfigSetScreenShot(WebCommonConfig* config, bool flag) {
if (_webGetShimKind(config) != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _webConfigSetFlag(config, WebArgType_ScreenShot, flag);
}
Result webConfigSetEcClientCert(WebCommonConfig* config, bool flag) { Result webConfigSetEcClientCert(WebCommonConfig* config, bool flag) {
WebShimKind shim = _webGetShimKind(config); WebShimKind shim = _webGetShimKind(config);
if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _webConfigSetU8(config, WebArgType_EcClientCert, flag); return _webConfigSetFlag(config, WebArgType_EcClientCert, flag);
} }
Result webConfigSetBootDisplayKind(WebCommonConfig* config, u32 kind) { Result webConfigSetBootDisplayKind(WebCommonConfig* config, u32 kind) {