libnx  v4.7.0
web.h
Go to the documentation of this file.
1 /**
2  * @file web.h
3  * @brief Wrapper for using the web LibraryApplets. See also: https://switchbrew.org/wiki/Internet_Browser
4  * @author p-sam, yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../services/applet.h"
10 #include "../services/caps.h"
11 #include "../services/acc.h"
12 #include "../kernel/mutex.h"
13 
14 /// This indicates the type of web-applet.
15 typedef enum {
16  WebShimKind_Shop = 1,
17  WebShimKind_Login = 2,
18  WebShimKind_Offline = 3,
19  WebShimKind_Share = 4,
20  WebShimKind_Web = 5,
21  WebShimKind_Wifi = 6,
22  WebShimKind_Lobby = 7,
23 } WebShimKind;
24 
25 /// ExitReason
26 typedef enum {
27  WebExitReason_ExitButton = 0x0, ///< User pressed the X button to exit.
28  WebExitReason_BackButton = 0x1, ///< User pressed the B button to exit, on the initial page.
29  WebExitReason_Requested = 0x2, ///< The applet exited since \ref webConfigRequestExit was used.
30  WebExitReason_LastUrl = 0x3, ///< The applet exited due to LastUrl handling, see \ref webReplyGetLastUrl.
31  WebExitReason_ErrorDialog = 0x7, ///< The applet exited after displaying an error dialog.
32  WebExitReason_UnknownE = 0xE, ///< Unknown
34 
35 /// Button values for \ref webConfigSetBootFooterButtonVisible.
36 typedef enum {
37  WebFooterButtonId_None = 0, ///< None, for empty \ref WebBootFooterButtonEntry. Invalid for \ref webConfigSetBootFooterButtonVisible input.
38  WebFooterButtonId_Type1 = 1, ///< Unknown button Id 1.
39  WebFooterButtonId_Type2 = 2, ///< Unknown button Id 2.
40  WebFooterButtonId_Type3 = 3, ///< Unknown button Id 3.
41  WebFooterButtonId_Type4 = 4, ///< Unknown button Id 4.
42  WebFooterButtonId_Type5 = 5, ///< Unknown button Id 5.
43  WebFooterButtonId_Type6 = 6, ///< Unknown button Id 6.
44  WebFooterButtonId_Max, ///< Values starting with this are invalid.
46 
47 /// WebSessionBootMode
48 typedef enum {
49  WebSessionBootMode_AllForeground = 0, ///< AllForeground. This is the default.
50  WebSessionBootMode_AllForegroundInitiallyHidden = 1, ///< AllForegroundInitiallyHidden
52 
53 /// WebSessionSendMessageKind
54 typedef enum {
55  WebSessionSendMessageKind_BrowserEngineContent = 0x0, ///< BrowserEngine Content
56  WebSessionSendMessageKind_SystemMessageAppear = 0x100, ///< SystemMessage Appear
57  WebSessionSendMessageKind_Ack = 0x1000, ///< Ack
59 
60 /// WebSessionReceiveMessageKind
61 typedef enum {
62  WebSessionReceiveMessageKind_BrowserEngineContent = 0x0, ///< BrowserEngine Content
63  WebSessionReceiveMessageKind_AckBrowserEngine = 0x1000, ///< Ack BrowserEngine
64  WebSessionReceiveMessageKind_AckSystemMessage = 0x1001, ///< Ack SystemMessage
66 
67 /// Struct for the WebWifi applet input storage.
68 typedef struct {
69  u32 unk_x0; ///< Official sw sets this to 0 with appletStorageWrite, separately from the rest of the config struct.
70  char conntest_url[0x100]; ///< Connection-test URL.
71  char initial_url[0x400]; ///< Initial URL navigated to by the applet.
72  Uuid uuid; ///< NIFM Network UUID. Only used by the applet when conntest_url is set.
73  u32 rev; ///< Input value for nifm cmd SetRequirementByRevision. Only used by the applet when conntest_url is set.
75 
76 /// Struct for the WebWifi applet output storage.
77 typedef struct {
78  u32 unk_x0; ///< Unknown.
79  Result res; ///< Result
81 
82 /// Config for WebWifi.
83 typedef struct {
84  WebWifiPageArg arg; ///< Arg data.
86 
87 /// TLV storage, starts with \ref WebArgHeader followed by \ref WebArgTLV entries.
88 typedef struct {
89  u8 data[0x2000]; ///< Raw TLV data storage.
91 
92 /// Common struct for the applet output storage, for non-TLV-storage.
93 typedef struct {
94  WebExitReason exitReason; ///< ExitReason
95  u32 pad; ///< Padding
96  char lastUrl[0x1000]; ///< LastUrl string
97  u64 lastUrlSize; ///< Size of LastUrl, including NUL-terminator.
99 
100 /// Header struct at offset 0 in the web Arg storage (non-webWifi).
101 typedef struct {
102  u16 total_entries; ///< Total \ref WebArgTLV entries following this struct.
103  u16 pad; ///< Padding
104  WebShimKind shimKind; ///< ShimKind
106 
107 /// Web TLV used in the web Arg storage.
108 typedef struct {
109  u16 type; ///< Type of this arg.
110  u16 size; ///< Size of the arg data following this struct.
111  u8 pad[4]; ///< Padding
113 
114 /// Config struct for web applets, non-WebWifi.
115 typedef struct {
116  WebCommonTLVStorage arg; ///< TLV storage.
117  AppletId appletid; ///< AppletId
118  u32 version; ///< CommonArgs applet version.
119  AppletHolder holder; ///< AppletHolder
121 
122 /// Common container struct for applets' reply data, from the output storage.
123 typedef struct {
124  bool type; ///< Type of reply: false = ret, true = storage.
125  WebShimKind shimKind; ///< ShimKind
126  WebCommonReturnValue ret; ///< Reply data for reply=false.
127  WebCommonTLVStorage storage; ///< Reply data for reply=true.
129 
130 /// Entry data for ::WebArgType_BootFooterButton.
131 typedef struct {
133  u8 visible;
134  u16 unk_x5;
135  u8 unk_x7;
137 
138 /// StorageHandleQueue
139 typedef struct {
140  s32 read_pos;
141  s32 write_pos;
142  s32 max_storages;
143  bool is_full;
144  AppletStorage storages[0x10];
146 
147 /// WebSession
148 typedef struct {
149  Mutex mutex;
150  WebCommonConfig *config;
151  struct {
152  u32 count;
153  u32 cur_size;
154  } queue[2];
155  WebSessionStorageHandleQueue storage_queue;
156 } WebSession;
157 
158 /// SessionMessageHeader
159 typedef struct {
160  u32 kind; ///< Message Kind (\ref WebSessionSendMessageKind / \ref WebSessionReceiveMessageKind)
161  u32 size; ///< Data size following the header.
162  u8 reserved[0x8]; ///< Unused
164 
165 /// Types for \ref WebArgTLV, input storage.
166 typedef enum {
167  WebArgType_Url = 0x1, ///< [1.0.0+] String, size 0xC00. Initial URL.
168  WebArgType_CallbackUrl = 0x3, ///< [1.0.0+] String, size 0x400.
169  WebArgType_CallbackableUrl = 0x4, ///< [1.0.0+] String, size 0x400.
170  WebArgType_ApplicationId = 0x5, ///< [1.0.0+] Offline-applet, u64 ApplicationId
171  WebArgType_DocumentPath = 0x6, ///< [1.0.0+] Offline-applet, string with size 0xC00.
172  WebArgType_DocumentKind = 0x7, ///< [1.0.0+] Offline-applet, u32 enum \WebDocumentKind.
173  WebArgType_SystemDataId = 0x8, ///< [1.0.0+] Offline-applet, u64 SystemDataId
174  WebArgType_ShareStartPage = 0x9, ///< [1.0.0+] u32 enum \WebShareStartPage
175  WebArgType_Whitelist = 0xA, ///< [1.0.0+] String, size 0x1000.
176  WebArgType_NewsFlag = 0xB, ///< [1.0.0+] u8 bool
177  WebArgType_UnknownC = 0xC, ///< [1.0.0+] u8
178  WebArgType_UnknownD = 0xD, ///< [1.0.0+] u8
179  WebArgType_Uid = 0xE, ///< [1.0.0+] \ref AccountUid, controls which user-specific savedata to mount.
180  WebArgType_AlbumEntry0 = 0xF, ///< [1.0.0+] Share-applet caps AlbumEntry, entry 0.
181  WebArgType_ScreenShot = 0x10, ///< [1.0.0+] u8 bool
182  WebArgType_EcClientCert = 0x11, ///< [1.0.0+] u8 bool
183  WebArgType_Unknown12 = 0x12, ///< [1.0.0+] u8
184  WebArgType_PlayReport = 0x13, ///< [1.0.0+] u8 bool
185  WebArgType_Unknown14 = 0x14, ///< [1.0.0+] u8
186  WebArgType_Unknown15 = 0x15, ///< [1.0.0+] u8
187  WebArgType_BootDisplayKind = 0x17, ///< [1.0.0+] u32 enum \ref WebBootDisplayKind
188  WebArgType_BackgroundKind = 0x18, ///< [1.0.0+] u32 enum \ref WebBackgroundKind
189  WebArgType_Footer = 0x19, ///< [1.0.0+] u8 bool
190  WebArgType_Pointer = 0x1A, ///< [1.0.0+] u8 bool
191  WebArgType_LeftStickMode = 0x1B, ///< [1.0.0+] u32 enum \ref WebLeftStickMode
192  WebArgType_KeyRepeatFrame0 = 0x1C, ///< [1.0.0+] s32 KeyRepeatFrame, first param
193  WebArgType_KeyRepeatFrame1 = 0x1D, ///< [1.0.0+] s32 KeyRepeatFrame, second param
194  WebArgType_BootAsMediaPlayerInverted = 0x1E, ///< [1.0.0+] u8 bool. With News on [3.0.0+] this is set after BootAsMediaPlayer with the value inverted.
195  WebArgType_DisplayUrlKind = 0x1F, ///< [1.0.0+] u8 bool, DisplayUrlKind (value = (input_enumval==0x1)).
196  WebArgType_BootAsMediaPlayer = 0x21, ///< [2.0.0+] u8 bool
197  WebArgType_ShopJump = 0x22, ///< [2.0.0+] u8 bool
198  WebArgType_MediaPlayerUserGestureRestriction = 0x23, ///< [2.0.0-5.1.0] u8 bool
199  WebArgType_MediaAutoPlay = 0x23, ///< [6.0.0+] u8 bool
200  WebArgType_LobbyParameter = 0x24, ///< [2.0.0+] String, size 0x100.
201  WebArgType_ApplicationAlbumEntry = 0x26, ///< [3.0.0+] Share-applet caps ApplicationAlbumEntry
202  WebArgType_JsExtension = 0x27, ///< [3.0.0+] u8 bool
203  WebArgType_AdditionalCommentText = 0x28, ///< [4.0.0+] String, size 0x100. Share-applet AdditionalCommentText.
204  WebArgType_TouchEnabledOnContents = 0x29, ///< [4.0.0+] u8 bool
205  WebArgType_UserAgentAdditionalString = 0x2A, ///< [4.0.0+] String, size 0x80.
206  WebArgType_AdditionalMediaData0 = 0x2B, ///< [4.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 0. If the user-input size is less than 0x10, the remaining data used for the TLV is cleared.
207  WebArgType_MediaPlayerAutoClose = 0x2C, ///< [4.0.0+] u8 bool
208  WebArgType_PageCache = 0x2D, ///< [4.0.0+] u8 bool
209  WebArgType_WebAudio = 0x2E, ///< [4.0.0+] u8 bool
210  WebArgType_2F = 0x2F, ///< [5.0.0+] u8
211  WebArgType_YouTubeVideoFlag = 0x31, ///< [5.0.0+] u8 bool Indicates that the built-in whitelist for YouTubeVideo should be used.
212  WebArgType_FooterFixedKind = 0x32, ///< [5.0.0+] u32 enum \ref WebFooterFixedKind
213  WebArgType_PageFade = 0x33, ///< [5.0.0+] u8 bool
214  WebArgType_MediaCreatorApplicationRatingAge = 0x34, ///< [5.0.0+] Share-applet 0x20-byte s8 array, MediaCreatorApplicationRatingAge.
215  WebArgType_BootLoadingIcon = 0x35, ///< [5.0.0+] u8 bool
216  WebArgType_PageScrollIndicator = 0x36, ///< [5.0.0+] u8 bool
217  WebArgType_MediaPlayerSpeedControl = 0x37, ///< [6.0.0+] u8 bool
218  WebArgType_AlbumEntry1 = 0x38, ///< [6.0.0+] Share-applet caps AlbumEntry, entry 1.
219  WebArgType_AlbumEntry2 = 0x39, ///< [6.0.0+] Share-applet caps AlbumEntry, entry 2.
220  WebArgType_AlbumEntry3 = 0x3A, ///< [6.0.0+] Share-applet caps AlbumEntry, entry 3.
221  WebArgType_AdditionalMediaData1 = 0x3B, ///< [6.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 1.
222  WebArgType_AdditionalMediaData2 = 0x3C, ///< [6.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 2.
223  WebArgType_AdditionalMediaData3 = 0x3D, ///< [6.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 3.
224  WebArgType_BootFooterButton = 0x3E, ///< [6.0.0+] Array of \ref WebBootFooterButtonEntry with 0x10 entries.
225  WebArgType_OverrideWebAudioVolume = 0x3F, ///< [6.0.0+] float
226  WebArgType_OverrideMediaAudioVolume = 0x40, ///< [6.0.0+] float
227  WebArgType_SessionBootMode = 0x41, ///< [7.0.0+] u32 enum \ref WebSessionBootMode
228  WebArgType_SessionFlag = 0x42, ///< [7.0.0+] u8 bool, enables using WebSession when set.
229  WebArgType_MediaPlayerUi = 0x43, ///< [8.0.0+] u8 bool
230  WebArgType_TransferMemory = 0x44, ///< [11.0.0+] u8 bool
231 } WebArgType;
232 
233 /// Types for \ref WebArgTLV, output storage.
234 typedef enum {
235  WebReplyType_ExitReason = 0x1, ///< [3.0.0+] u32 ExitReason
236  WebReplyType_LastUrl = 0x2, ///< [3.0.0+] string
237  WebReplyType_LastUrlSize = 0x3, ///< [3.0.0+] u64
238  WebReplyType_SharePostResult = 0x4, ///< [3.0.0+] u32 SharePostResult
239  WebReplyType_PostServiceName = 0x5, ///< [3.0.0+] string
240  WebReplyType_PostServiceNameSize = 0x6, ///< [3.0.0+] u64
241  WebReplyType_PostId = 0x7, ///< [3.0.0+] string
242  WebReplyType_PostIdSize = 0x8, ///< [3.0.0+] u64
244 } WebReplyType;
245 
246 /// This controls the kind of content to mount with Offline-applet.
247 typedef enum {
248  WebDocumentKind_OfflineHtmlPage = 0x1, ///< Use the HtmlDocument NCA content from the application.
249  WebDocumentKind_ApplicationLegalInformation = 0x2, ///< Use the LegalInformation NCA content from the application.
250  WebDocumentKind_SystemDataPage = 0x3, ///< Use the Data NCA content from the specified SystemData, see also: https://switchbrew.org/wiki/Title_list#System_Data_Archives
252 
253 /// This controls the initial page for ShareApplet, used by \ref webShareCreate.
254 typedef enum {
255  WebShareStartPage_Default = 0, ///< The default "/" page.
256  WebShareStartPage_Settings = 1, ///< The "/settings/" page.
258 
259 /// Kind values for \ref webConfigSetBootDisplayKind. Controls the background color while displaying the loading screen during applet boot. Also controls the BackgroundKind when value is non-zero.
260 typedef enum {
261  WebBootDisplayKind_Default = 0, ///< Default. BackgroundKind is controlled by \ref WebBackgroundKind.
262  WebBootDisplayKind_White = 1, ///< White background. Used by \ref webOfflineCreate for docKind ::WebDocumentKind_ApplicationLegalInformation/::WebDocumentKind_SystemDataPage.
263  WebBootDisplayKind_Black = 2, ///< Black background.
264  WebBootDisplayKind_Unknown3 = 3, ///< Unknown. Used by \ref webShareCreate.
265  WebBootDisplayKind_Unknown4 = 4, ///< Unknown. Used by \ref webLobbyCreate.
267 
268 /// Kind values for \ref webConfigSetBackgroundKind. Controls the background color while displaying the loading screen during applet boot. Only used when \ref WebBootDisplayKind is ::WebBootDisplayKind_Default. If the applet was not launched by an Application, the applet will only use WebBackgroundKind_Default.
269 typedef enum {
270  WebBackgroundKind_Default = 0, ///< Default. Same as ::WebBootDisplayKind_White/::WebBootDisplayKind_Black, determined via ::WebArgType_BootAsMediaPlayer.
271  WebBackgroundKind_Unknown1 = 1, ///< Unknown. Same as ::WebBootDisplayKind_Unknown3.
272  WebBackgroundKind_Unknown2 = 2, ///< Unknown. Same as ::WebBootDisplayKind_Unknown4. Used by \ref webLobbyCreate.
274 
275 /// Mode values for \ref webConfigSetLeftStickMode. Controls the initial mode, this can be toggled by the user via the pressing the left-stick button. If the Pointer flag is set to false (\ref webConfigSetPointer), only ::WebLeftStickMode_Cursor will be used and mode toggle by the user is disabled (input value ignored).
276 typedef enum {
277  WebLeftStickMode_Pointer = 0, ///< The user can directly control the pointer via the left-stick.
278  WebLeftStickMode_Cursor = 1, ///< The user can only select elements on the page via the left-stick.
280 
281 /// Kind values for \ref webConfigSetFooterFixedKind. Controls UI footer display behaviour.
282 typedef enum {
283  WebFooterFixedKind_Default = 0, ///< Default. Footer is hidden while scrolling.
284  WebFooterFixedKind_Always = 1, ///< Footer is always displayed regardless of scrolling.
285  WebFooterFixedKind_Hidden = 2, ///< Footer is hidden regardless of scrolling.
287 
288 /**
289  * @brief Creates the config for WifiWebAuthApplet. This is the captive portal applet.
290  * @param config WebWifiConfig object.
291  * @param conntest_url URL used for the connection-test requests. When empty/NULL the applet will test the connection with nifm and throw an error on failure.
292  * @param initial_url Initial URL navigated to by the applet.
293  * @param uuid NIFM Network UUID, for nifm cmd SetNetworkProfileId. Value 0 can be used. Only used by the applet when conntest_url is set.
294  * @param rev Input value for nifm cmd SetRequirementByRevision. Value 0 can be used. Only used by the applet when conntest_url is set.
295  */
296 void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char* initial_url, Uuid uuid, u32 rev);
297 
298 /**
299  * @brief Launches WifiWebAuthApplet with the specified config and waits for it to exit.
300  * @param config WebWifiConfig object.
301  * @param out Optional output applet reply data, can be NULL.
302  */
304 
305 /**
306  * @brief Creates the config for WebApplet. This applet uses an URL whitelist loaded from the user-process host Application, which is only loaded when running under an Application.
307  * @note Sets ::WebArgType_UnknownD, and ::WebArgType_Unknown12 on pre-3.0.0, to value 1.
308  * @param config WebCommonConfig object.
309  * @param url Initial URL navigated to by the applet.
310  */
311 Result webPageCreate(WebCommonConfig* config, const char* url);
312 
313 /**
314  * @brief Creates the config for WebApplet. This is based on \ref webPageCreate, for News. Hence other functions referencing \ref webPageCreate also apply to this.
315  * @note The domain from the input URL is automatically whitelisted, in addition to any already loaded whitelist.
316  * @note Sets ::WebArgType_UnknownD to value 1, and sets ::WebArgType_NewsFlag to true. Also uses \ref webConfigSetEcClientCert and \ref webConfigSetShopJump with flag=true.
317  * @param config WebCommonConfig object.
318  * @param url Initial URL navigated to by the applet.
319  */
320 Result webNewsCreate(WebCommonConfig* config, const char* url);
321 
322 /**
323  * @brief Creates the config for WebApplet. This is based on \ref webPageCreate, for YouTubeVideo. Hence other functions referencing \ref webPageCreate also apply to this. This uses a whitelist which essentially only allows youtube embed/ URLs (without mounting content from the host Application).
324  * @note This is only available on [5.0.0+].
325  * @note Sets ::WebArgType_UnknownD to value 1, and sets ::WebArgType_YouTubeVideoFlag to true. Also uses \ref webConfigSetBootAsMediaPlayer with flag=true.
326  * @param config WebCommonConfig object.
327  * @param url Initial URL navigated to by the applet.
328  */
329 Result webYouTubeVideoCreate(WebCommonConfig* config, const char* url);
330 
331 /**
332  * @brief Creates the config for Offline-applet. This applet uses data loaded from content.
333  * @note Uses \ref webConfigSetLeftStickMode with ::WebLeftStickMode_Cursor and sets ::WebArgType_BootAsMediaPlayerInverted to false. Uses \ref webConfigSetPointer with flag = docKind == ::WebDocumentKind_OfflineHtmlPage.
334  * @note For docKind ::WebDocumentKind_ApplicationLegalInformation / ::WebDocumentKind_SystemDataPage, uses \ref webConfigSetFooter with flag=true and \ref webConfigSetBackgroundKind with ::WebBackgroundKind_Default.
335  * @note For docKind ::WebDocumentKind_SystemDataPage, uses \ref webConfigSetBootDisplayKind with ::WebBootDisplayKind_White.
336  * @note Sets ::WebArgType_Unknown14/::WebArgType_Unknown15 to value 1. With docKind ::WebDocumentKind_ApplicationLegalInformation, uses \ref webConfigSetBootDisplayKind with ::WebBootDisplayKind_White.
337  * @note Sets ::WebArgType_UnknownC to value 1.
338  * @note With docKind ::WebDocumentKind_ApplicationLegalInformation, uses \ref webConfigSetEcClientCert with flag=true.
339  * @note With docKind ::WebDocumentKind_OfflineHtmlPage on pre-3.0.0, sets ::WebArgType_Unknown12 to value 1.
340  * @note Lastly, sets the TLVs as needed for the input params.
341  * @param config WebCommonConfig object.
342  * @param docKind \ref WebDocumentKind
343  * @param id Id to load the content from. With docKind = ::WebDocumentKind_OfflineHtmlPage, id=0 should be used to specify the user-process application (non-zero is ignored with this docKind).
344  * @param docPath Initial document path in RomFS, without the leading '/'. For ::WebDocumentKind_OfflineHtmlPage, this is relative to "html-document/" in RomFS. For the other docKind values, this is relative to "/" in RomFS. This path must contain ".htdocs/".
345  */
346 Result webOfflineCreate(WebCommonConfig* config, WebDocumentKind docKind, u64 id, const char* docPath);
347 
348 /**
349  * @brief Creates the config for ShareApplet. This applet is for social media posting/settings.
350  * @note If a non-zero uid isn't set with \ref webConfigSetUid prior to using \ref webConfigShow, the applet will launch the profile-selector applet to select an account.
351  * @note An error will be displayed if neither \ref webConfigSetAlbumEntry, nor \ref webConfigSetApplicationAlbumEntry, nor \ref webConfigAddAlbumEntryAndMediaData are used prior to using \ref webConfigShow, with ::WebShareStartPage_Default.
352  * @note Uses \ref webConfigSetLeftStickMode with ::WebLeftStickMode_Cursor, \ref webConfigSetUid with uid=0, \ref webConfigSetDisplayUrlKind with kind=true, and sets ::WebArgType_Unknown14/::WebArgType_Unknown15 to value 1. Uses \ref webConfigSetBootDisplayKind with ::WebBootDisplayKind_Unknown3.
353  * @param config WebCommonConfig object.
354  * @param page \ref WebShareStartPage
355  */
357 
358 /**
359  * @brief Creates the config for LobbyApplet. This applet is for "Nintendo Switch Online Lounge".
360  * @note Only available on [2.0.0+].
361  * @note If a non-zero uid isn't set with \ref webConfigSetUid prior to using \ref webConfigShow, the applet will launch the profile-selector applet to select an account.
362  * @note Uses \ref webConfigSetLeftStickMode with ::WebLeftStickMode_Cursor, \ref webConfigSetPointer with flag=false on [3.0.0+], \ref webConfigSetUid with uid=0, and sets ::WebArgType_Unknown14/::WebArgType_Unknown15 to value 1. Uses \ref webConfigSetBootDisplayKind with ::WebBootDisplayKind_Unknown4, \ref webConfigSetBackgroundKind with ::WebBackgroundKind_Unknown2, and sets ::WebArgType_BootAsMediaPlayerInverted to false.
363  * @param config WebCommonConfig object.
364  */
366 
367 /**
368  * @brief Sets the CallbackUrl. See also \ref webReplyGetLastUrl.
369  * @note With Offline-applet for LastUrl handling, it compares the domain with "localhost" instead.
370  * @note Only available with config created by \ref webPageCreate or with Share-applet.
371  * @param config WebCommonConfig object.
372  * @param url URL
373  */
375 
376 /**
377  * @brief Sets the CallbackableUrl.
378  * @note Only available with config created by \ref webPageCreate.
379  * @param config WebCommonConfig object.
380  * @param url URL
381  */
383 
384 /**
385  * @brief Sets the whitelist.
386  * @note Only available with config created by \ref webPageCreate.
387  * @note If the whitelist isn't formatted properly, the applet will exit briefly after the applet is launched.
388  * @param config WebCommonConfig object.
389  * @param whitelist Whitelist string, each line is a regex for each whitelisted URL.
390  */
391 Result webConfigSetWhitelist(WebCommonConfig* config, const char* whitelist);
392 
393 /**
394  * @brief Sets the account uid. Controls which user-specific savedata to mount.
395  * @note Only available with config created by \ref webPageCreate, \ref webLobbyCreate, or with Share-applet.
396  * @note Used automatically by \ref webShareCreate and \ref webLobbyCreate with uid=0.
397  * @param config WebCommonConfig object.
398  * @param uid \ref AccountUid
399  */
401 
402 /**
403  * @brief Sets the Share CapsAlbumEntry.
404  * @note Only available with config created by \ref webShareCreate.
405  * @param config WebCommonConfig object.
406  * @param entry \ref CapsAlbumEntry
407  */
409 
410 /**
411  * @brief Sets the ScreenShot flag, which controls whether screen-shot capture is allowed.
412  * @note Only available with config created by \ref webPageCreate.
413  * @param config WebCommonConfig object.
414  * @param flag Flag
415  */
417 
418 /**
419  * @brief Sets the EcClientCert flag.
420  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate.
421  * @note Used automatically by \ref webOfflineCreate, depending on the docKind.
422  * @note Used automatically by \ref webNewsCreate with flag=true.
423  * @param config WebCommonConfig object.
424  * @param flag Flag
425  */
427 
428 /**
429  * @brief Sets whether PlayReport is enabled.
430  * @note Only available with config created by \ref webOfflineCreate.
431  * @param config WebCommonConfig object.
432  * @param flag Flag
433  */
435 
436 /**
437  * @brief Sets the BootDisplayKind.
438  * @note Only available with config created by \ref webOfflineCreate, \ref webShareCreate, \ref webPageCreate, or \ref webLobbyCreate..
439  * @note Used automatically by \ref webOfflineCreate, depending on the docKind.
440  * @note Used automatically by \ref webShareCreate with kind=::WebBootDisplayKind_Unknown3.
441  * @note Used automatically by \ref webLobbyCreate with kind=::WebBootDisplayKind_Unknown4.
442  * @param config WebCommonConfig object.
443  * @param kind \ref WebBootDisplayKind
444  */
446 
447 /**
448  * @brief Sets the BackgroundKind.
449  * @note Only available with config created by \ref webOfflineCreate, \ref webPageCreate, or \ref webLobbyCreate.
450  * @note Used automatically by \ref webOfflineCreate, depending on the docKind.
451  * @note Used automatically by \ref webLobbyCreate with kind=2.
452  * @param config WebCommonConfig object.
453  * @param kind \ref WebBackgroundKind
454  */
456 
457 /**
458  * @brief Sets the whether the UI footer is enabled.
459  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate.
460  * @note Used automatically by \ref webOfflineCreate, depending on the docKind.
461  * @param config WebCommonConfig object.
462  * @param flag Flag
463  */
465 
466 /**
467  * @brief Sets the whether the Pointer is enabled. See also \ref WebLeftStickMode.
468  * @note Only available with config created by \ref webOfflineCreate, \ref webPageCreate, or \ref webLobbyCreate.
469  * @note Used automatically by \ref webOfflineCreate.
470  * @note Used automatically by \ref webLobbyCreate with flag=false on [3.0.0+].
471  * @param config WebCommonConfig object.
472  * @param flag Flag
473  */
475 
476 /**
477  * @brief Sets the LeftStickMode.
478  * @note Only available with config created by \ref webOfflineCreate, \ref webShareCreate, \ref webPageCreate, or \ref webLobbyCreate.
479  * @note Used automatically by \ref webOfflineCreate, \ref webShareCreate, and \ref webLobbyCreate with ::WebLeftStickMode_Cursor.
480  * @param config WebCommonConfig object.
481  * @param mode Mode, different enums for Web and Offline.
482  */
484 
485 /**
486  * @brief Sets the KeyRepeatFrame.
487  * @note Only available with config created by \ref webOfflineCreate.
488  * @param config WebCommonConfig object.
489  * @param inval0 First input param.
490  * @param inval1 Second input param.
491  */
493 
494 /**
495  * @brief Sets the DisplayUrlKind.
496  * @note Only available with config created by \ref webShareCreate or \ref webPageCreate.
497  * @param config WebCommonConfig object.
498  * @note Used automatically by \ref webShareCreate with kind=true.
499  * @param kind Kind
500  */
502 
503 /**
504  * @brief Sets the BootAsMediaPlayer flag.
505  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [2.0.0+].
506  * @note With config created by \ref webNewsCreate on [3.0.0+], this also sets ::WebArgType_BootAsMediaPlayerInverted to !flag.
507  * @param config WebCommonConfig object.
508  * @param flag Flag. true = BootAsMediaPlayer, false = BootAsWebPage.
509  */
511 
512 /**
513  * @brief Sets the ShopJump flag.
514  * @note Only available with config created by \ref webPageCreate on [2.0.0+].
515  * @note Used automatically by \ref webNewsCreate with flag=true.
516  * @param config WebCommonConfig object.
517  * @param flag Flag
518  */
520 
521 /**
522  * @brief Sets the MediaPlayerUserGestureRestriction flag.
523  * @note Only available with config created by \ref webPageCreate on [2.0.0-5.1.0].
524  * @param config WebCommonConfig object.
525  * @param flag Flag
526  */
528 
529 /**
530  * @brief Sets whether MediaAutoPlay is enabled.
531  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [6.0.0+].
532  * @param config WebCommonConfig object.
533  * @param flag Flag
534  */
536 
537 /**
538  * @brief Sets the LobbyParameter.
539  * @note Only available with config created by \ref webLobbyCreate.
540  * @param config WebCommonConfig object.
541  * @param str String
542  */
544 
545 /**
546  * @brief Sets the Share CapsApplicationAlbumEntry.
547  * @note Only available with config created by \ref webShareCreate on [3.0.0+].
548  * @param config WebCommonConfig object.
549  * @param entry \ref CapsApplicationAlbumEntry, see also capssu.h.
550  */
552 
553 /**
554  * @brief Sets whether JsExtension is enabled.
555  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [3.0.0+].
556  * @param config WebCommonConfig object.
557  * @param flag Flag
558  */
560 
561 /**
562  * @brief Sets the Share AdditionalCommentText.
563  * @note Only available with config created by \ref webShareCreate on [4.0.0+].
564  * @param config WebCommonConfig object.
565  * @param str String
566  */
568 
569 /**
570  * @brief Sets the TouchEnabledOnContents flag.
571  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [4.0.0+].
572  * @param config WebCommonConfig object.
573  * @param flag Flag
574  */
576 
577 /**
578  * @brief Sets the UserAgentAdditionalString. " " followed by this string are appended to the normal User-Agent string.
579  * @note Only available with config created by \ref webPageCreate on [4.0.0+].
580  * @param config WebCommonConfig object.
581  * @param str String
582  */
584 
585 /**
586  * @brief Sets the Share AdditionalMediaData.
587  * @note Only available with config created by \ref webShareCreate on [4.0.0+].
588  * @param config WebCommonConfig object.
589  * @param data Input data
590  * @param size Size of the input data, max size is 0x10.
591  */
592 Result webConfigSetAdditionalMediaData(WebCommonConfig* config, const u8* data, size_t size);
593 
594 /**
595  * @brief Sets the MediaPlayerAutoClose flag.
596  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [4.0.0+].
597  * @param config WebCommonConfig object.
598  * @param flag Flag
599  */
601 
602 /**
603  * @brief Sets whether PageCache is enabled.
604  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [4.0.0+].
605  * @param config WebCommonConfig object.
606  * @param flag Flag
607  */
609 
610 /**
611  * @brief Sets whether WebAudio is enabled.
612  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [4.0.0+].
613  * @param config WebCommonConfig object.
614  * @param flag Flag
615  */
617 
618 /**
619  * @brief Sets the FooterFixedKind.
620  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [5.0.0+].
621  * @param config WebCommonConfig object.
622  * @param kind \ref WebFooterFixedKind
623  */
625 
626 /**
627  * @brief Sets the PageFade flag.
628  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [5.0.0+].
629  * @param config WebCommonConfig object.
630  * @param flag Flag
631  */
633 
634 /**
635  * @brief Sets the Share MediaCreatorApplicationRatingAge.
636  * @note Only available with config created by \ref webShareCreate on [5.0.0+].
637  * @param config WebCommonConfig object.
638  * @param data 0x20-byte input data
639  */
641 
642 /**
643  * @brief Sets the BootLoadingIcon flag.
644  * @note Only available with config created by \ref webOfflineCreate on [5.0.0+].
645  * @param config WebCommonConfig object.
646  * @param flag Flag
647  */
649 
650 /**
651  * @brief Sets the PageScrollIndicator flag.
652  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [5.0.0+].
653  * @param config WebCommonConfig object.
654  * @param flag Flag
655  */
657 
658 /**
659  * @brief Sets whether MediaPlayerSpeedControl is enabled.
660  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [6.0.0+].
661  * @param config WebCommonConfig object.
662  * @param flag Flag
663  */
665 
666 /**
667  * @brief Adds a pair of Share CapsAlbumEntry + optionally AdditionalMediaData. This can be used up to 4 times, for setting multiple pairs.
668  * @note Only available with config created by \ref webShareCreate on [6.0.0+].
669  * @param config WebCommonConfig object.
670  * @param entry \ref CapsAlbumEntry
671  * @param data Input data for AdditionalMediaData. Optional, can be NULL.
672  * @param size Size of the input data, max size is 0x10. Optional, can be 0.
673  */
674 Result webConfigAddAlbumEntryAndMediaData(WebCommonConfig* config, const CapsAlbumEntry *entry, const u8* data, size_t size);
675 
676 /**
677  * @brief Sets whether the specified BootFooterButton is visible.
678  * @note Only available with config created by \ref webOfflineCreate on [6.0.0+].
679  * @param config WebCommonConfig object.
680  * @param button \ref WebFooterButtonId
681  * @param visible Visible flag.
682  */
684 
685 /**
686  * @brief Sets OverrideWebAudioVolume.
687  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [6.0.0+].
688  * @param config WebCommonConfig object.
689  * @param value Value
690  */
692 
693 /**
694  * @brief Sets OverrideMediaAudioVolume.
695  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [6.0.0+].
696  * @param config WebCommonConfig object.
697  * @param value Value
698  */
700 
701 /**
702  * @brief Sets \ref WebSessionBootMode.
703  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [7.0.0+].
704  * @param config WebCommonConfig object.
705  * @param mode \ref WebSessionBootMode
706  */
708 
709 /**
710  * @brief Sets whether MediaPlayerUi is enabled.
711  * @note Only available with config created by \ref webOfflineCreate on [8.0.0+].
712  * @param config WebCommonConfig object.
713  * @param flag Flag
714  */
716 
717 /**
718  * @brief Sets whether TransferMemory is enabled.
719  * @note Only available with config created by \ref webPageCreate on [11.0.0+].
720  * @param config WebCommonConfig object.
721  * @param flag Flag
722  */
724 
725 /**
726  * @brief Launches the {web applet} with the specified config and waits for it to exit.
727  * @param config WebCommonConfig object.
728  * @param out Optional output applet reply data, can be NULL.
729  */
731 
732 /**
733  * @brief Request the applet to exit after \ref webConfigShow was used, while the applet is still running. This is for use from another thread.
734  * @param config WebCommonConfig object.
735  */
737 
738 /**
739  * @brief Gets the ExitReason from the specified reply.
740  * @param reply WebCommonReply object.
741  * @param exitReason Output \ref WebExitReason
742  */
744 
745 /**
746  * @brief Gets the LastUrl from the specified reply. When the applet loads a page where the beginning of the URL matches the URL from \ref webConfigSetCallbackUrl, the applet will exit and set LastUrl to that URL (exit doesn't occur when \ref webConfigSetCallbackableUrl was used).
747  * @note This is only available with ::WebExitReason_LastUrl (string is empty otherwise).
748  * @note If you want to allocate a string buffer on heap, you can call this with outstr=NULL/outstr_maxsize=0 to get the out_size, then call it again with the allocated buffer.
749  * @param reply WebCommonReply object.
750  * @param outstr Output string buffer. If NULL, the string is not loaded.
751  * @param outstr_maxsize Size of the buffer, including NUL-terminator. If outstr is set, this size must be >1. The size used for the actual string-copy is this size-1, to make sure the output is NUL-terminated (the entire buffer is cleared first).
752  * @param out_size Output string length including NUL-terminator, for the original input string in the reply loaded from a separate size field.
753  */
754 Result webReplyGetLastUrl(WebCommonReply *reply, char *outstr, size_t outstr_maxsize, size_t *out_size);
755 
756 /**
757  * @brief Gets the SharePostResult from the specified reply.
758  * @note Only available with reply data from ShareApplet on [3.0.0+].
759  * @param reply WebCommonReply object.
760  * @param sharePostResult Output sharePostResult
761  */
763 
764 /**
765  * @brief Gets the PostServiceName from the specified reply.
766  * @note Only available with reply data from ShareApplet on [3.0.0+].
767  * @note If you want to allocate a string buffer on heap, you can call this with outstr=NULL/outstr_maxsize=0 to get the out_size, then call it again with the allocated buffer.
768  * @param reply WebCommonReply object.
769  * @param outstr Output string buffer. If NULL, the string is not loaded.
770  * @param outstr_maxsize Size of the buffer, including NUL-terminator. If outstr is set, this size must be >1. The size used for the actual string-copy is this size-1, to make sure the output is NUL-terminated (the entire buffer is cleared first).
771  * @param out_size Output string length including NUL-terminator, for the original input string in the reply loaded from a separate size field.
772  */
773 Result webReplyGetPostServiceName(WebCommonReply *reply, char *outstr, size_t outstr_maxsize, size_t *out_size);
774 
775 /**
776  * @brief Gets the PostId from the specified reply.
777  * @note Only available with reply data from ShareApplet on [3.0.0+].
778  * @note If you want to allocate a string buffer on heap, you can call this with outstr=NULL/outstr_maxsize=0 to get the out_size, then call it again with the allocated buffer.
779  * @param reply WebCommonReply object.
780  * @param outstr Output string buffer. If NULL, the string is not loaded.
781  * @param outstr_maxsize Size of the buffer, including NUL-terminator. If outstr is set, this size must be >1. The size used for the actual string-copy is this size-1, to make sure the output is NUL-terminated (the entire buffer is cleared first).
782  * @param out_size Output string length including NUL-terminator, for the original input string in the reply loaded from a separate size field.
783  */
784 Result webReplyGetPostId(WebCommonReply *reply, char *outstr, size_t outstr_maxsize, size_t *out_size);
785 
786 /**
787  * @brief Gets the MediaPlayerAutoClosedByCompletion flag from the specified reply.
788  * @note Only available with reply data from Web on [8.0.0+].
789  * @param reply WebCommonReply object.
790  * @param flag Output flag
791  */
793 
794 /**
795  * @brief Creates a \ref WebSession object.
796  * @param s \ref WebSession
797  * @param config WebCommonConfig object.
798  */
800 
801 /**
802  * @brief Closes a \ref WebSession object.
803  * @param s \ref WebSession
804  */
806 
807 /**
808  * @brief Launches the applet for \ref WebSession.
809  * @note Only available with config created by \ref webOfflineCreate or \ref webPageCreate, on [7.0.0+].
810  * @note Do not use \ref webConfigShow when using WebSession.
811  * @param s \ref WebSession
812  * @param[out] out_event Output Event with autoclear=false, from \ref appletHolderGetExitEvent. Optional, can be NULL.
813  */
815 
816 /**
817  * @brief Waits for the applet to exit.
818  * @note This must be used before \ref webSessionClose, when \ref webSessionStart was used successfully.
819  * @param s \ref WebSession
820  * @param out Optional output applet reply data, can be NULL.
821  */
823 
824 /**
825  * @brief Request the applet to exit.
826  * @note Use this instead of \ref webConfigRequestExit, when using WebSession.
827  * @param s \ref WebSession
828  */
830 
831 /**
832  * @brief Request the applet to Appear, this is only needed with ::WebSessionBootMode_AllForegroundInitiallyHidden.
833  * @note This should not be used before \ref webSessionStart.
834  * @param s \ref WebSession
835  * @param[out] flag Whether the message was sent successfully.
836  */
838 
839 /**
840  * @brief TrySendContentMessage
841  * @note This should not be used before \ref webSessionStart.
842  * @note The JS-side for this is only available when JsExtension is enabled via \ref webConfigSetJsExtension.
843  * @note The JS-side may ignore this if it's sent too soon after the applet launches.
844  * @param s \ref WebSession
845  * @param[in] content Input content NUL-terminated string.
846  * @param[in] size Size of content.
847  * @param[out] flag Whether the message was sent successfully.
848  */
849 Result webSessionTrySendContentMessage(WebSession *s, const char *content, u32 size, bool *flag);
850 
851 /**
852  * @brief TryReceiveContentMessage
853  * @note This should not be used before \ref webSessionStart.
854  * @note The JS-side for this is only available when JsExtension is enabled via \ref webConfigSetJsExtension.
855  * @param s \ref WebSession
856  * @param[out] content Output content string, always NUL-terminated.
857  * @param[in] size Max size of content.
858  * @param[out] out_size Original content size, prior to being clamped to the specified size param.
859  * @param[out] flag Whether the message was received successfully.
860  */
861 Result webSessionTryReceiveContentMessage(WebSession *s, char *content, u64 size, u64 *out_size, bool *flag);
862 
AppletId
AppletId.
Definition: applet.h:91
_LOCK_T Mutex
Mutex datatype, defined in newlib.
Definition: mutex.h:12
Account UserId.
Definition: acc.h:25
LibraryApplet state.
Definition: applet.h:241
applet IStorage
Definition: applet.h:235
AlbumEntry.
Definition: caps.h:100
ApplicationAlbumEntry.
Definition: caps.h:106
Kernel-mode event structure.
Definition: event.h:13
Definition: types.h:48
Header struct at offset 0 in the web Arg storage (non-webWifi).
Definition: web.h:101
u16 total_entries
Total WebArgTLV entries following this struct.
Definition: web.h:102
u16 pad
Padding.
Definition: web.h:103
WebShimKind shimKind
ShimKind.
Definition: web.h:104
Web TLV used in the web Arg storage.
Definition: web.h:108
u16 type
Type of this arg.
Definition: web.h:109
u16 size
Size of the arg data following this struct.
Definition: web.h:110
Entry data for WebArgType_BootFooterButton.
Definition: web.h:131
Config struct for web applets, non-WebWifi.
Definition: web.h:115
u32 version
CommonArgs applet version.
Definition: web.h:118
WebCommonTLVStorage arg
TLV storage.
Definition: web.h:116
AppletId appletid
AppletId.
Definition: web.h:117
AppletHolder holder
AppletHolder.
Definition: web.h:119
Common container struct for applets' reply data, from the output storage.
Definition: web.h:123
bool type
Type of reply: false = ret, true = storage.
Definition: web.h:124
WebCommonTLVStorage storage
Reply data for reply=true.
Definition: web.h:127
WebShimKind shimKind
ShimKind.
Definition: web.h:125
WebCommonReturnValue ret
Reply data for reply=false.
Definition: web.h:126
Common struct for the applet output storage, for non-TLV-storage.
Definition: web.h:93
u32 pad
Padding.
Definition: web.h:95
u64 lastUrlSize
Size of LastUrl, including NUL-terminator.
Definition: web.h:97
WebExitReason exitReason
ExitReason.
Definition: web.h:94
TLV storage, starts with WebArgHeader followed by WebArgTLV entries.
Definition: web.h:88
SessionMessageHeader.
Definition: web.h:159
u32 kind
Message Kind (WebSessionSendMessageKind / WebSessionReceiveMessageKind)
Definition: web.h:160
u32 size
Data size following the header.
Definition: web.h:161
StorageHandleQueue.
Definition: web.h:139
WebSession.
Definition: web.h:148
Config for WebWifi.
Definition: web.h:83
WebWifiPageArg arg
Arg data.
Definition: web.h:84
Struct for the WebWifi applet input storage.
Definition: web.h:68
u32 rev
Input value for nifm cmd SetRequirementByRevision. Only used by the applet when conntest_url is set.
Definition: web.h:73
Uuid uuid
NIFM Network UUID. Only used by the applet when conntest_url is set.
Definition: web.h:72
u32 unk_x0
Official sw sets this to 0 with appletStorageWrite, separately from the rest of the config struct.
Definition: web.h:69
Struct for the WebWifi applet output storage.
Definition: web.h:77
Result res
Result.
Definition: web.h:79
u32 unk_x0
Unknown.
Definition: web.h:78
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
int8_t s8
8-bit signed integer.
Definition: types.h:25
#define NX_PACKED
Packs a struct so that it won't include padding bytes.
Definition: types.h:63
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
Result webConfigSetUid(WebCommonConfig *config, AccountUid uid)
Sets the account uid.
Result webConfigAddAlbumEntryAndMediaData(WebCommonConfig *config, const CapsAlbumEntry *entry, const u8 *data, size_t size)
Adds a pair of Share CapsAlbumEntry + optionally AdditionalMediaData.
Result webConfigSetOverrideWebAudioVolume(WebCommonConfig *config, float value)
Sets OverrideWebAudioVolume.
WebSessionReceiveMessageKind
WebSessionReceiveMessageKind.
Definition: web.h:61
@ WebSessionReceiveMessageKind_AckSystemMessage
Ack SystemMessage.
Definition: web.h:64
@ WebSessionReceiveMessageKind_AckBrowserEngine
Ack BrowserEngine.
Definition: web.h:63
@ WebSessionReceiveMessageKind_BrowserEngineContent
BrowserEngine Content.
Definition: web.h:62
Result webConfigSetKeyRepeatFrame(WebCommonConfig *config, s32 inval0, s32 inval1)
Sets the KeyRepeatFrame.
Result webLobbyCreate(WebCommonConfig *config)
Creates the config for LobbyApplet.
Result webConfigSetAdditionalMediaData(WebCommonConfig *config, const u8 *data, size_t size)
Sets the Share AdditionalMediaData.
Result webConfigSetLeftStickMode(WebCommonConfig *config, WebLeftStickMode mode)
Sets the LeftStickMode.
Result webShareCreate(WebCommonConfig *config, WebShareStartPage page)
Creates the config for ShareApplet.
Result webConfigSetCallbackUrl(WebCommonConfig *config, const char *url)
Sets the CallbackUrl.
Result webReplyGetLastUrl(WebCommonReply *reply, char *outstr, size_t outstr_maxsize, size_t *out_size)
Gets the LastUrl from the specified reply.
Result webConfigSetTouchEnabledOnContents(WebCommonConfig *config, bool flag)
Sets the TouchEnabledOnContents flag.
void webSessionClose(WebSession *s)
Closes a WebSession object.
WebReplyType
Types for WebArgTLV, output storage.
Definition: web.h:234
@ WebReplyType_MediaPlayerAutoClosedByCompletion
[8.0.0+] u8 bool
Definition: web.h:243
@ WebReplyType_LastUrl
[3.0.0+] string
Definition: web.h:236
@ WebReplyType_PostId
[3.0.0+] string
Definition: web.h:241
@ WebReplyType_PostServiceNameSize
[3.0.0+] u64
Definition: web.h:240
@ WebReplyType_PostServiceName
[3.0.0+] string
Definition: web.h:239
@ WebReplyType_LastUrlSize
[3.0.0+] u64
Definition: web.h:237
@ WebReplyType_PostIdSize
[3.0.0+] u64
Definition: web.h:242
@ WebReplyType_ExitReason
[3.0.0+] u32 ExitReason
Definition: web.h:235
@ WebReplyType_SharePostResult
[3.0.0+] u32 SharePostResult
Definition: web.h:238
void webSessionCreate(WebSession *s, WebCommonConfig *config)
Creates a WebSession object.
void webWifiCreate(WebWifiConfig *config, const char *conntest_url, const char *initial_url, Uuid uuid, u32 rev)
Creates the config for WifiWebAuthApplet.
Result webSessionWaitForExit(WebSession *s, WebCommonReply *out)
Waits for the applet to exit.
Result webOfflineCreate(WebCommonConfig *config, WebDocumentKind docKind, u64 id, const char *docPath)
Creates the config for Offline-applet.
Result webReplyGetPostId(WebCommonReply *reply, char *outstr, size_t outstr_maxsize, size_t *out_size)
Gets the PostId from the specified reply.
Result webConfigSetEcClientCert(WebCommonConfig *config, bool flag)
Sets the EcClientCert flag.
Result webConfigSetMediaPlayerAutoClose(WebCommonConfig *config, bool flag)
Sets the MediaPlayerAutoClose flag.
Result webReplyGetExitReason(WebCommonReply *reply, WebExitReason *exitReason)
Gets the ExitReason from the specified reply.
Result webConfigSetPageCache(WebCommonConfig *config, bool flag)
Sets whether PageCache is enabled.
Result webConfigSetWebAudio(WebCommonConfig *config, bool flag)
Sets whether WebAudio is enabled.
WebShimKind
This indicates the type of web-applet.
Definition: web.h:15
WebSessionBootMode
WebSessionBootMode.
Definition: web.h:48
@ WebSessionBootMode_AllForegroundInitiallyHidden
AllForegroundInitiallyHidden.
Definition: web.h:50
@ WebSessionBootMode_AllForeground
AllForeground. This is the default.
Definition: web.h:49
Result webConfigSetFooter(WebCommonConfig *config, bool flag)
Sets the whether the UI footer is enabled.
Result webConfigSetPageFade(WebCommonConfig *config, bool flag)
Sets the PageFade flag.
Result webConfigSetFooterFixedKind(WebCommonConfig *config, WebFooterFixedKind kind)
Sets the FooterFixedKind.
Result webConfigSetMediaCreatorApplicationRatingAge(WebCommonConfig *config, const s8 *data)
Sets the Share MediaCreatorApplicationRatingAge.
WebLeftStickMode
Mode values for webConfigSetLeftStickMode. Controls the initial mode, this can be toggled by the user...
Definition: web.h:276
@ WebLeftStickMode_Cursor
The user can only select elements on the page via the left-stick.
Definition: web.h:278
@ WebLeftStickMode_Pointer
The user can directly control the pointer via the left-stick.
Definition: web.h:277
Result webYouTubeVideoCreate(WebCommonConfig *config, const char *url)
Creates the config for WebApplet.
Result webConfigSetDisplayUrlKind(WebCommonConfig *config, bool kind)
Sets the DisplayUrlKind.
Result webPageCreate(WebCommonConfig *config, const char *url)
Creates the config for WebApplet.
Result webConfigSetCallbackableUrl(WebCommonConfig *config, const char *url)
Sets the CallbackableUrl.
WebBackgroundKind
Kind values for webConfigSetBackgroundKind. Controls the background color while displaying the loadin...
Definition: web.h:269
@ WebBackgroundKind_Unknown2
Unknown. Same as WebBootDisplayKind_Unknown4. Used by webLobbyCreate.
Definition: web.h:272
@ WebBackgroundKind_Default
Default. Same as WebBootDisplayKind_White/WebBootDisplayKind_Black, determined via WebArgType_BootAsM...
Definition: web.h:270
@ WebBackgroundKind_Unknown1
Unknown. Same as WebBootDisplayKind_Unknown3.
Definition: web.h:271
Result webConfigSetPlayReport(WebCommonConfig *config, bool flag)
Sets whether PlayReport is enabled.
WebFooterButtonId
Button values for webConfigSetBootFooterButtonVisible.
Definition: web.h:36
@ WebFooterButtonId_Type2
Unknown button Id 2.
Definition: web.h:39
@ WebFooterButtonId_Type3
Unknown button Id 3.
Definition: web.h:40
@ WebFooterButtonId_Max
Values starting with this are invalid.
Definition: web.h:44
@ WebFooterButtonId_None
None, for empty WebBootFooterButtonEntry. Invalid for webConfigSetBootFooterButtonVisible input.
Definition: web.h:37
@ WebFooterButtonId_Type4
Unknown button Id 4.
Definition: web.h:41
@ WebFooterButtonId_Type5
Unknown button Id 5.
Definition: web.h:42
@ WebFooterButtonId_Type1
Unknown button Id 1.
Definition: web.h:38
@ WebFooterButtonId_Type6
Unknown button Id 6.
Definition: web.h:43
Result webConfigSetLobbyParameter(WebCommonConfig *config, const char *str)
Sets the LobbyParameter.
Result webConfigSetBootAsMediaPlayer(WebCommonConfig *config, bool flag)
Sets the BootAsMediaPlayer flag.
Result webNewsCreate(WebCommonConfig *config, const char *url)
Creates the config for WebApplet.
Result webConfigShow(WebCommonConfig *config, WebCommonReply *out)
Launches the {web applet} with the specified config and waits for it to exit.
Result webConfigSetMediaPlayerUserGestureRestriction(WebCommonConfig *config, bool flag)
Sets the MediaPlayerUserGestureRestriction flag.
Result webConfigSetBootDisplayKind(WebCommonConfig *config, WebBootDisplayKind kind)
Sets the BootDisplayKind.
Result webConfigRequestExit(WebCommonConfig *config)
Request the applet to exit after webConfigShow was used, while the applet is still running.
WebArgType
Types for WebArgTLV, input storage.
Definition: web.h:166
@ WebArgType_SystemDataId
[1.0.0+] Offline-applet, u64 SystemDataId
Definition: web.h:173
@ WebArgType_DisplayUrlKind
[1.0.0+] u8 bool, DisplayUrlKind (value = (input_enumval==0x1)).
Definition: web.h:195
@ WebArgType_MediaPlayerSpeedControl
[6.0.0+] u8 bool
Definition: web.h:217
@ WebArgType_AdditionalMediaData1
[6.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 1.
Definition: web.h:221
@ WebArgType_UnknownD
[1.0.0+] u8
Definition: web.h:178
@ WebArgType_2F
[5.0.0+] u8
Definition: web.h:210
@ WebArgType_Url
[1.0.0+] String, size 0xC00. Initial URL.
Definition: web.h:167
@ WebArgType_PlayReport
[1.0.0+] u8 bool
Definition: web.h:184
@ WebArgType_ShareStartPage
[1.0.0+] u32 enum \WebShareStartPage
Definition: web.h:174
@ WebArgType_FooterFixedKind
[5.0.0+] u32 enum WebFooterFixedKind
Definition: web.h:212
@ WebArgType_SessionBootMode
[7.0.0+] u32 enum WebSessionBootMode
Definition: web.h:227
@ WebArgType_OverrideWebAudioVolume
[6.0.0+] float
Definition: web.h:225
@ WebArgType_AdditionalMediaData0
[4.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 0. If the user-input size is les...
Definition: web.h:206
@ WebArgType_PageCache
[4.0.0+] u8 bool
Definition: web.h:208
@ WebArgType_CallbackUrl
[1.0.0+] String, size 0x400.
Definition: web.h:168
@ WebArgType_Unknown14
[1.0.0+] u8
Definition: web.h:185
@ WebArgType_SessionFlag
[7.0.0+] u8 bool, enables using WebSession when set.
Definition: web.h:228
@ WebArgType_PageScrollIndicator
[5.0.0+] u8 bool
Definition: web.h:216
@ WebArgType_KeyRepeatFrame0
[1.0.0+] s32 KeyRepeatFrame, first param
Definition: web.h:192
@ WebArgType_BootLoadingIcon
[5.0.0+] u8 bool
Definition: web.h:215
@ WebArgType_MediaCreatorApplicationRatingAge
[5.0.0+] Share-applet 0x20-byte s8 array, MediaCreatorApplicationRatingAge.
Definition: web.h:214
@ WebArgType_AlbumEntry1
[6.0.0+] Share-applet caps AlbumEntry, entry 1.
Definition: web.h:218
@ WebArgType_LobbyParameter
[2.0.0+] String, size 0x100.
Definition: web.h:200
@ WebArgType_MediaPlayerUserGestureRestriction
[2.0.0-5.1.0] u8 bool
Definition: web.h:198
@ WebArgType_MediaAutoPlay
[6.0.0+] u8 bool
Definition: web.h:199
@ WebArgType_UnknownC
[1.0.0+] u8
Definition: web.h:177
@ WebArgType_BootAsMediaPlayer
[2.0.0+] u8 bool
Definition: web.h:196
@ WebArgType_WebAudio
[4.0.0+] u8 bool
Definition: web.h:209
@ WebArgType_UserAgentAdditionalString
[4.0.0+] String, size 0x80.
Definition: web.h:205
@ WebArgType_PageFade
[5.0.0+] u8 bool
Definition: web.h:213
@ WebArgType_Footer
[1.0.0+] u8 bool
Definition: web.h:189
@ WebArgType_BootFooterButton
[6.0.0+] Array of WebBootFooterButtonEntry with 0x10 entries.
Definition: web.h:224
@ WebArgType_TouchEnabledOnContents
[4.0.0+] u8 bool
Definition: web.h:204
@ WebArgType_TransferMemory
[11.0.0+] u8 bool
Definition: web.h:230
@ WebArgType_AdditionalMediaData2
[6.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 2.
Definition: web.h:222
@ WebArgType_AlbumEntry2
[6.0.0+] Share-applet caps AlbumEntry, entry 2.
Definition: web.h:219
@ WebArgType_YouTubeVideoFlag
[5.0.0+] u8 bool Indicates that the built-in whitelist for YouTubeVideo should be used.
Definition: web.h:211
@ WebArgType_Whitelist
[1.0.0+] String, size 0x1000.
Definition: web.h:175
@ WebArgType_Pointer
[1.0.0+] u8 bool
Definition: web.h:190
@ WebArgType_EcClientCert
[1.0.0+] u8 bool
Definition: web.h:182
@ WebArgType_DocumentPath
[1.0.0+] Offline-applet, string with size 0xC00.
Definition: web.h:171
@ WebArgType_ShopJump
[2.0.0+] u8 bool
Definition: web.h:197
@ WebArgType_MediaPlayerUi
[8.0.0+] u8 bool
Definition: web.h:229
@ WebArgType_BootDisplayKind
[1.0.0+] u32 enum WebBootDisplayKind
Definition: web.h:187
@ WebArgType_OverrideMediaAudioVolume
[6.0.0+] float
Definition: web.h:226
@ WebArgType_Unknown15
[1.0.0+] u8
Definition: web.h:186
@ WebArgType_CallbackableUrl
[1.0.0+] String, size 0x400.
Definition: web.h:169
@ WebArgType_AdditionalMediaData3
[6.0.0+] Share-applet 0x10-byte u8 array, AdditionalMediaData. Entry 3.
Definition: web.h:223
@ WebArgType_AlbumEntry3
[6.0.0+] Share-applet caps AlbumEntry, entry 3.
Definition: web.h:220
@ WebArgType_LeftStickMode
[1.0.0+] u32 enum WebLeftStickMode
Definition: web.h:191
@ WebArgType_BootAsMediaPlayerInverted
[1.0.0+] u8 bool. With News on [3.0.0+] this is set after BootAsMediaPlayer with the value inverted.
Definition: web.h:194
@ WebArgType_MediaPlayerAutoClose
[4.0.0+] u8 bool
Definition: web.h:207
@ WebArgType_NewsFlag
[1.0.0+] u8 bool
Definition: web.h:176
@ WebArgType_Unknown12
[1.0.0+] u8
Definition: web.h:183
@ WebArgType_KeyRepeatFrame1
[1.0.0+] s32 KeyRepeatFrame, second param
Definition: web.h:193
@ WebArgType_DocumentKind
[1.0.0+] Offline-applet, u32 enum \WebDocumentKind.
Definition: web.h:172
@ WebArgType_JsExtension
[3.0.0+] u8 bool
Definition: web.h:202
@ WebArgType_AdditionalCommentText
[4.0.0+] String, size 0x100. Share-applet AdditionalCommentText.
Definition: web.h:203
@ WebArgType_BackgroundKind
[1.0.0+] u32 enum WebBackgroundKind
Definition: web.h:188
@ WebArgType_Uid
[1.0.0+] AccountUid, controls which user-specific savedata to mount.
Definition: web.h:179
@ WebArgType_ApplicationAlbumEntry
[3.0.0+] Share-applet caps ApplicationAlbumEntry
Definition: web.h:201
@ WebArgType_ApplicationId
[1.0.0+] Offline-applet, u64 ApplicationId
Definition: web.h:170
@ WebArgType_ScreenShot
[1.0.0+] u8 bool
Definition: web.h:181
@ WebArgType_AlbumEntry0
[1.0.0+] Share-applet caps AlbumEntry, entry 0.
Definition: web.h:180
Result webConfigSetBootLoadingIcon(WebCommonConfig *config, bool flag)
Sets the BootLoadingIcon flag.
Result webReplyGetMediaPlayerAutoClosedByCompletion(WebCommonReply *reply, bool *flag)
Gets the MediaPlayerAutoClosedByCompletion flag from the specified reply.
WebBootDisplayKind
Kind values for webConfigSetBootDisplayKind. Controls the background color while displaying the loadi...
Definition: web.h:260
@ WebBootDisplayKind_Default
Default. BackgroundKind is controlled by WebBackgroundKind.
Definition: web.h:261
@ WebBootDisplayKind_Unknown4
Unknown. Used by webLobbyCreate.
Definition: web.h:265
@ WebBootDisplayKind_Unknown3
Unknown. Used by webShareCreate.
Definition: web.h:264
@ WebBootDisplayKind_Black
Black background.
Definition: web.h:263
@ WebBootDisplayKind_White
White background. Used by webOfflineCreate for docKind WebDocumentKind_ApplicationLegalInformation/We...
Definition: web.h:262
Result webConfigSetWhitelist(WebCommonConfig *config, const char *whitelist)
Sets the whitelist.
WebDocumentKind
This controls the kind of content to mount with Offline-applet.
Definition: web.h:247
@ WebDocumentKind_SystemDataPage
Use the Data NCA content from the specified SystemData, see also: https://switchbrew....
Definition: web.h:250
@ WebDocumentKind_OfflineHtmlPage
Use the HtmlDocument NCA content from the application.
Definition: web.h:248
@ WebDocumentKind_ApplicationLegalInformation
Use the LegalInformation NCA content from the application.
Definition: web.h:249
WebShareStartPage
This controls the initial page for ShareApplet, used by webShareCreate.
Definition: web.h:254
@ WebShareStartPage_Settings
The "/settings/" page.
Definition: web.h:256
@ WebShareStartPage_Default
The default "/" page.
Definition: web.h:255
Result webConfigSetPageScrollIndicator(WebCommonConfig *config, bool flag)
Sets the PageScrollIndicator flag.
Result webSessionTryReceiveContentMessage(WebSession *s, char *content, u64 size, u64 *out_size, bool *flag)
TryReceiveContentMessage.
Result webConfigSetUserAgentAdditionalString(WebCommonConfig *config, const char *str)
Sets the UserAgentAdditionalString.
Result webConfigSetPointer(WebCommonConfig *config, bool flag)
Sets the whether the Pointer is enabled.
WebSessionSendMessageKind
WebSessionSendMessageKind.
Definition: web.h:54
@ WebSessionSendMessageKind_Ack
Ack.
Definition: web.h:57
@ WebSessionSendMessageKind_BrowserEngineContent
BrowserEngine Content.
Definition: web.h:55
@ WebSessionSendMessageKind_SystemMessageAppear
SystemMessage Appear.
Definition: web.h:56
Result webConfigSetOverrideMediaAudioVolume(WebCommonConfig *config, float value)
Sets OverrideMediaAudioVolume.
Result webSessionRequestExit(WebSession *s)
Request the applet to exit.
Result webReplyGetPostServiceName(WebCommonReply *reply, char *outstr, size_t outstr_maxsize, size_t *out_size)
Gets the PostServiceName from the specified reply.
Result webConfigSetScreenShot(WebCommonConfig *config, bool flag)
Sets the ScreenShot flag, which controls whether screen-shot capture is allowed.
Result webConfigSetMediaAutoPlay(WebCommonConfig *config, bool flag)
Sets whether MediaAutoPlay is enabled.
Result webWifiShow(WebWifiConfig *config, WebWifiReturnValue *out)
Launches WifiWebAuthApplet with the specified config and waits for it to exit.
Result webReplyGetSharePostResult(WebCommonReply *reply, u32 *sharePostResult)
Gets the SharePostResult from the specified reply.
Result webConfigSetAlbumEntry(WebCommonConfig *config, const CapsAlbumEntry *entry)
Sets the Share CapsAlbumEntry.
WebExitReason
ExitReason.
Definition: web.h:26
@ WebExitReason_LastUrl
The applet exited due to LastUrl handling, see webReplyGetLastUrl.
Definition: web.h:30
@ WebExitReason_ExitButton
User pressed the X button to exit.
Definition: web.h:27
@ WebExitReason_Requested
The applet exited since webConfigRequestExit was used.
Definition: web.h:29
@ WebExitReason_ErrorDialog
The applet exited after displaying an error dialog.
Definition: web.h:31
@ WebExitReason_UnknownE
Unknown.
Definition: web.h:32
@ WebExitReason_BackButton
User pressed the B button to exit, on the initial page.
Definition: web.h:28
Result webConfigSetBootMode(WebCommonConfig *config, WebSessionBootMode mode)
Sets WebSessionBootMode.
Result webConfigSetMediaPlayerUi(WebCommonConfig *config, bool flag)
Sets whether MediaPlayerUi is enabled.
Result webConfigSetAdditionalCommentText(WebCommonConfig *config, const char *str)
Sets the Share AdditionalCommentText.
Result webSessionAppear(WebSession *s, bool *flag)
Request the applet to Appear, this is only needed with WebSessionBootMode_AllForegroundInitiallyHidde...
Result webConfigSetBackgroundKind(WebCommonConfig *config, WebBackgroundKind kind)
Sets the BackgroundKind.
WebFooterFixedKind
Kind values for webConfigSetFooterFixedKind. Controls UI footer display behaviour.
Definition: web.h:282
@ WebFooterFixedKind_Default
Default. Footer is hidden while scrolling.
Definition: web.h:283
@ WebFooterFixedKind_Always
Footer is always displayed regardless of scrolling.
Definition: web.h:284
@ WebFooterFixedKind_Hidden
Footer is hidden regardless of scrolling.
Definition: web.h:285
Result webConfigSetShopJump(WebCommonConfig *config, bool flag)
Sets the ShopJump flag.
Result webConfigSetTransferMemory(WebCommonConfig *config, bool flag)
Sets whether TransferMemory is enabled.
Result webConfigSetMediaPlayerSpeedControl(WebCommonConfig *config, bool flag)
Sets whether MediaPlayerSpeedControl is enabled.
Result webConfigSetBootFooterButtonVisible(WebCommonConfig *config, WebFooterButtonId button, bool visible)
Sets whether the specified BootFooterButton is visible.
Result webSessionStart(WebSession *s, Event **out_event)
Launches the applet for WebSession.
Result webConfigSetJsExtension(WebCommonConfig *config, bool flag)
Sets whether JsExtension is enabled.
Result webSessionTrySendContentMessage(WebSession *s, const char *content, u32 size, bool *flag)
TrySendContentMessage.
Result webConfigSetApplicationAlbumEntry(WebCommonConfig *config, CapsApplicationAlbumEntry *entry)
Sets the Share CapsApplicationAlbumEntry.