• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Enums
2
3> **NOTE**
4>
5> The initial APIs of this component are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
6
7## MessageLevel
8
9Enumerates the information levels of **ConsoleMessage**.
10
11**System capability**: SystemCapability.Web.Webview.Core
12
13| Name   | Value| Description   |
14| ----- | -- | ---- |
15| Debug | 1 | Debug level.|
16| Error | 4 | Error level.|
17| Info  | 2 | Information level.|
18| Log   | 5 | Log level.|
19| Warn  | 3 | Warning level.|
20
21## MixedMode
22
23**System capability**: SystemCapability.Web.Webview.Core
24
25| Name       | Value| Description                                |
26| ---------- | -- | ---------------------------------- |
27| All        | 0 | Loose mode: HTTP and HTTPS hybrid content can be loaded. This means that all insecure content can be loaded.|
28| Compatible | 1 | Compatible mode: HTTP and HTTPS hybrid content can be loaded in compatibility mode. This means that some insecure content may be loaded.          |
29| None       | 2 | Strict mode: HTTP and HTTPS hybrid content cannot be loaded.              |
30
31## HitTestType
32
33 **System capability**: SystemCapability.Web.Webview.Core
34
35| Name           | Value| Description                      |
36| ------------- | -- | ------------------------ |
37| EditText      | 0 | Editable area.                 |
38| Email         | 1 | Email address.                 |
39| HttpAnchor    | 2 | Hyperlink whose **src** is **http**.          |
40| HttpAnchorImg | 3 | Image with a hyperlink, where **src** is **http**.|
41| Img           | 4 | HTML::img tag.            |
42| Map           | 5 | Geographical address.                   |
43| Phone         | 6 | Phone number.                   |
44| Unknown       | 7 | Unknown content.                   |
45
46## CacheMode
47
48**System capability**: SystemCapability.Web.Webview.Core
49
50| Name     | Value| Description                                  |
51| ------- | -- | ------------------------------------ |
52| Default<sup>9+</sup> | 0 | The cache that has not expired is preferentially used to load resources. If the cache is invalid or no cache is available, resources are obtained from the Internet.|
53| None    | 1 | The cache (including expired caches) is preferentially used to load resources. If no cache is available, resources are obtained from the Internet.    |
54| Online  | 2 | The cache is not used to load the resources. All resources are forcibly obtained from the Internet.              |
55| Only    | 3 | The local cache alone is used to load the resources.                       |
56
57
58## OverScrollMode<sup>11+</sup>
59
60Enumerates whether to enable overscroll mode.
61
62 **System capability**: SystemCapability.Web.Webview.Core
63
64| Name    | Value| Description         |
65| ------ | -- | ----------- |
66| NEVER  | 0 | The overscroll mode is disabled.|
67| ALWAYS | 1 | The overscroll mode is enabled.|
68
69## BlurOnKeyboardHideMode<sup>14+</sup>
70
71Enumerates whether the **Web** component loses focus when the soft keyboard is hidden.
72
73**System capability**: SystemCapability.Web.Webview.Core
74
75**Parameters**
76
77| Name    | Value| Description         |
78| ------ | -- | ----------- |
79| SILENT  | 0 | The **Web** component does not lose focus when the soft keyboard is hidden.|
80| BLUR | 1 | The **Web** component loses focus when the soft keyboard is hidden, and the focus moves from the text box to the web body.|
81
82## WebDarkMode<sup>9+</sup>
83
84Enumerates whether to enable web dark mode.
85
86**System capability**: SystemCapability.Web.Webview.Core
87
88| Name  | Value| Description          |
89| ---- | -- | ------------ |
90| Off  | 0 | The web dark mode is disabled.  |
91| On   | 1 | The web dark mode is enabled.  |
92| Auto | 2 | The web dark mode setting follows the system setting.|
93
94## WebCaptureMode<sup>10+</sup>
95
96Enumerates the web screen capture modes.
97
98**System capability**: SystemCapability.Web.Webview.Core
99
100| Name         | Value| Description     |
101| ----------- | -- | ------- |
102| HOME_SCREEN | 0 | Home screen capture mode.|
103
104## ThreatType<sup>11+</sup>
105
106Enumerates the website threat types.
107
108**System capability**: SystemCapability.Web.Webview.Core
109
110| Name            | Value| Description                  |
111| ---------------- | -- | ----------------------|
112| THREAT_ILLEGAL  | 0 | Illegal website.             |
113| THREAT_FRAUD    | 1 | Fraudulent website.             |
114| THREAT_RISK     | 2 | Website that poses security risks.     |
115| THREAT_WARNING  | 3 | Website suspected to contain unsafe content.|
116
117## RenderExitReason<sup>9+</sup>
118
119Enumerates the reasons why the rendering process exits.
120
121**System capability**: SystemCapability.Web.Webview.Core
122
123| Name                        | Value| Description               |
124| -------------------------- | -- | ----------------- |
125| ProcessAbnormalTermination | 0 | The rendering process exits abnormally.        |
126| ProcessWasKilled           | 1 | The rendering process receives a SIGKILL message or is manually terminated.|
127| ProcessCrashed             | 2 | The rendering process crashes due to segmentation or other errors.   |
128| ProcessOom                 | 3 | The program memory is insufficient.          |
129| ProcessExitUnknown         | 4 | Other reason.            |
130
131## SslError<sup>9+</sup>
132
133Enumerates the error codes returned by **onSslErrorEventReceive** API.
134
135**System capability**: SystemCapability.Web.Webview.Core
136
137| Name          | Value| Description         |
138| ------------ | -- | ----------- |
139| Invalid      | 0 | Minor error.      |
140| HostMismatch | 1 | The host name does not match.    |
141| DateInvalid  | 2 | The certificate has an invalid date.    |
142| Untrusted    | 3 | The certificate issuer is not trusted.|
143
144## FileSelectorMode<sup>9+</sup>
145
146Enumerates the modes of the file selector.
147
148**System capability**: SystemCapability.Web.Webview.Core
149
150| Name                  | Value| Description        |
151| -------------------- | -- | ---------- |
152| FileOpenMode         | 0 | Open and upload a file. |
153| FileOpenMultipleMode | 1 | Open and upload multiple files. |
154| FileOpenFolderMode   | 2 | Open and upload a folder.|
155| FileSaveMode         | 3 | Save a file.   |
156
157## WebLayoutMode<sup>11+</sup>
158
159Enumerates the web layout modes.
160
161**System capability**: SystemCapability.Web.Webview.Core
162
163| Name         | Value| Description                |
164| ----------- | -- | ------------------ |
165| NONE        | 0 | The web layout follows the system.        |
166| FIT_CONTENT | 1 | The web layout adapts to the page size.|
167
168## RenderProcessNotRespondingReason<sup>12+</sup>
169
170Enumerates the reasons why the rendering process does not respond.
171
172**System capability**: SystemCapability.Web.Webview.Core
173
174| Name                          | Value| Description          |
175| ----------------------------- | -- | ------------ |
176| INPUT_TIMEOUT                  | 0 | The input event response sent to the rendering process times out.  |
177| NAVIGATION_COMMIT_TIMEOUT      | 1 | The navigation for loading a new web page times out.  |
178
179## ProtectedResourceType<sup>9+</sup>
180
181**System capability**: SystemCapability.Web.Webview.Core
182
183| Name                         | Value| Description           |
184| --------------------------- | --------------- | ------------- |
185| MidiSysex                   | TYPE_MIDI_SYSEX | MIDI SYSEX resource.<br>Currently, only permission events can be reported. MIDI devices are not yet supported.|
186| VIDEO_CAPTURE<sup>10+</sup> | TYPE_VIDEO_CAPTURE | Video capture resource, such as a camera. |
187| AUDIO_CAPTURE<sup>10+</sup> | TYPE_AUDIO_CAPTURE | Audio capture resource, such as a microphone.|
188| SENSOR<sup>12+</sup>        | TYPE_SENSOR | Sensor resource, such as an acceleration sensor.|
189
190## ContextMenuSourceType<sup>9+</sup>
191
192**System capability**: SystemCapability.Web.Webview.Core
193
194| Name      | Value| Description        |
195| --------- | -- |------------ |
196| None      | 0 | Other event sources.|
197| Mouse     | 1 | Mouse event.  |
198| LongPress | 2 | Long press event.  |
199
200## ContextMenuMediaType<sup>9+</sup>
201
202**System capability**: SystemCapability.Web.Webview.Core
203
204| Name   | Value| Description           |
205| ----- | -- | ------------- |
206| None  | 0 | Non-special media or other media types.|
207| Image | 1 | Image.          |
208| Video<sup>20+</sup> | 2 | Video.          |
209| Audio<sup>20+</sup> | 3 | Audio.          |
210
211## ContextMenuInputFieldType<sup>9+</sup>
212
213Enumerates the input field types.
214
215**System capability**: SystemCapability.Web.Webview.Core
216
217| Name       | Value| Description                         |
218| --------- | -- | --------------------------- |
219| None      | 0 | Non-input field.                      |
220| PlainText | 1 | Plain text field, such as the text, search, or email field.|
221| Password  | 2 | Password field.                      |
222| Number    | 3 | Number field.                      |
223| Telephone | 4 | Phone number field.                    |
224| Other     | 5 | Field of any other type.                      |
225
226## NativeEmbedStatus<sup>11+</sup>
227
228Enumerates the lifecycles of the same-layer tag. When a same-layer tag exists on the loaded page, **CREATE** is triggered. When a same-layer tag is moved or is enlarged, **UPDATE** is triggered. When the page exits, **DESTROY** is triggered.
229
230**System capability**: SystemCapability.Web.Webview.Core
231
232| Name                          | Value| Description          |
233| ----------------------------- | -- | ------------ |
234| CREATE                        | 0 | The same-layer tag is created.  |
235| UPDATE                        | 1 | The same-layer tag is updated.  |
236| DESTROY                       | 2 | The same-layer tag is destroyed.|
237| ENTER_BFCACHE<sup>12+</sup>   | 3 | The same-layer tag enters BFCache.  |
238| LEAVE_BFCACHE<sup>12+</sup>   | 4 | The same-layer tag leaves BFCache.|
239
240## ContextMenuEditStateFlags<sup>9+</sup>
241
242Enumerates the context menu edit state flags. This enum can be used in bitwise OR mode. For example, to support **CAN_CUT**, **CAN_COPY**, and **CAN_SELECT_ALL** at the same time, use **CAN_CUT | CAN_COPY | CAN_SELECT_ALL** or **11**.
243
244**System capability**: SystemCapability.Web.Webview.Core
245
246| Name           | Value| Description    |
247| -------------- | -- | -------- |
248| NONE           | 0 | Editing is not allowed.|
249| CAN_CUT        | 1 << 0 | Cutting is supported.|
250| CAN_COPY       | 1 << 1 | Copying is supported.|
251| CAN_PASTE      | 1 << 2 | Pasting is supported.|
252| CAN_SELECT_ALL | 1 << 3 | Selecting all is supported.|
253
254## WebNavigationType<sup>11+</sup>
255
256Enumerates the navigation types.
257
258**System capability**: SystemCapability.Web.Webview.Core
259
260| Name                          | Value| Description          |
261| ----------------------------- | -- | ------------ |
262| UNKNOWN                       | 0 | Unknown type.  |
263| MAIN_FRAME_NEW_ENTRY          | 1 | Navigation to a new history entry from the main document.  |
264| MAIN_FRAME_EXISTING_ENTRY     | 2 | Navigation to an existing history entry from the main document.|
265| NAVIGATION_TYPE_NEW_SUBFRAME  | 4 | User-triggered navigation from a subdocument.|
266| NAVIGATION_TYPE_AUTO_SUBFRAME | 5 | Non-user-triggered navigation from a subdocument.|
267
268## RenderMode<sup>12+</sup>
269
270Enumerates the rendering modes of the **Web** component. By default, the asynchronous rendering mode is used.
271
272The asynchronous rendering mode is recommended because it has better performance and lower power consumption.
273
274**System capability**: SystemCapability.Web.Webview.Core
275
276| Name                          | Value| Description          |
277| ----------------------------- | -- | ------------ |
278| ASYNC_RENDER                        | 0 | The **Web** component as a graphic surface node is rendered asynchronously and displayed independently. The maximum width of the **Web** component is 7,680 px (physical pixel).  |
279| SYNC_RENDER                        | 1 | The **Web** component as a graphic canvas node is rendered synchronously and displayed together with the system component. The maximum width of the **Web** component is 500,000 px (physical pixel).  |
280
281## ViewportFit<sup>12+</sup>
282
283Enumerates the viewport types available for **viewport-fit** in the web page **\<meta>** tag.
284
285**System capability**: SystemCapability.Web.Webview.Core
286
287| Name                          | Value| Description          |
288| ----------------------------- | -- | ------------ |
289| AUTO                  | 0 | The entire web page is visible. Default value.  |
290| CONTAINS      | 1 | The initial layout viewport and the visual viewport fit within the largest rectangle that adapts to the device's display screen.  |
291| COVER      | 2| The initial layout viewport and the visual viewport are confined within the bounding rectangle of the device's physical screen.  |
292
293## WebKeyboardAvoidMode<sup>12+</sup>
294
295Enumerates the soft keyboard avoidance modes.
296
297**System capability**: SystemCapability.Web.Webview.Core
298
299| Name              | Value| Description          |
300| ------------------ | -- | ------------ |
301| RESIZE_VISUAL      | 0 | For soft keyboard avoidance, the visual viewport is resized, but not the layout viewport.  |
302| RESIZE_CONTENT     | 1 | For soft keyboard avoidance, both the visual viewport and layout viewport are resized. Default value.|
303| OVERLAYS_CONTENT   | 2 | No viewport is resized, and soft keyboard avoidance is not triggered.  |
304
305## WebElementType<sup>13+</sup>
306
307Enumerates the web element types.
308
309**System capability**: SystemCapability.Web.Webview.Core
310
311**Parameters**
312
313| Name      | Value| Description             |
314| --------- | -- | ----------------- |
315| IMAGE     | 1 | Image.|
316| LINK<sup>20+</sup>     | 2 | Hyperlink.|
317
318## WebResponseType<sup>13+</sup>
319
320Enumerates the response types of the menu.
321
322**System capability**: SystemCapability.Web.Webview.Core
323
324**Parameters**
325
326| Name           | Value| Description               |
327| -------------- | -- | ------------------  |
328| LONG_PRESS     | 1 | The menu is displayed when the component is long-pressed.|
329
330## AudioSessionType<sup>20+</sup>
331
332Enumerates the web audio types in the application.
333
334**System capability**: SystemCapability.Web.Webview.Core
335
336**Parameters**
337
338| Name           | Value| Description               |
339| -------------- | -- | ------------------  |
340| AMBIENT     | 3 | Web game sounds and system music can be played at the same time. This value is applicable to web game scenarios. Its corresponding system audio stream type is **STREAM_USAGE_GAME**.|
341
342## GestureFocusMode<sup>20+</sup>
343
344Enumerates the focus modes.
345
346**System capability**: SystemCapability.Web.Webview.Core
347
348| Name                      | Value| Description          |
349| -------------------------- | -- | ------------- |
350| DEFAULT                    | 0 | The **Web** component applies for the focus when it is touched, long-pressed, swiped, or zoomed.|
351| GESTURE_TAP_AND_LONG_PRESS | 1 | The **Web** component applies for the focus only when it is touched and long-pressed. The swipe and zoom gestures do not apply for the focus.|
352
353## WebBypassVsyncCondition<sup>20+</sup>
354
355Enumerates whether to allow the rendering process to bypass the vsync scheduling.
356
357**System capability**: SystemCapability.Web.Webview.Core
358
359| Name         | Value| Description                |
360| ----------- | -- | ------------------ |
361| NONE        | 0 | The rendering process does not bypass the vsync scheduling. Default value.        |
362| SCROLLBY_FROM_ZERO_OFFSET | 1 | When **scrollby** is used (only the scrolling offset is supported) and the scrolling offset of the web page is **0**, the rendering process bypasses the vsync scheduling.|
363
364## PdfLoadResult<sup>20+</sup>
365
366Enumerates the PDF page loading results.
367
368**System capability**: SystemCapability.Web.Webview.Core
369
370| Name            | Value   | Description                                      |
371| -------------- | ---- | ---------------------------------------- |
372| LOAD_SUCCESS | 0 | The PDF file is successfully loaded.   |
373| PARSE_ERROR_FILE | 1 | The PDF file fails to be loaded.|
374| PARSE_ERROR_FORMAT | 2 | The PDF file format is not supported.|
375| PARSE_ERROR_PASSWORD | 3 | The PDF file password is incorrect.|
376| PARSE_ERROR_HANDLER | 4 | The PDF file fails to be processed.|
377