openharmony 鸿蒙 arkts-apis-webview-e

2026-08-25 浏览 (1)

Enums

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

WebHitTestType

Enumerates the cursor node types for the getLastHitTest API.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
EditText0Editable area.
Email1Email address.
HttpAnchor2Hyperlink, where src is http.
HttpAnchorImg3Image with a hyperlink, where src is http + HTML::img.
Img4HTML::img tag.
Map5Geographical address.
Phone6Phone number.
Unknown7Unknown content.

SecureDnsMode10+

Enumerates the modes in which the Web component uses HTTPDNS.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
OFF0HTTPDNS is not used. This value can be used to revoke the previously used HTTPDNS configuration.
AUTO1HTTPDNS is used in automatic mode. If the specified HTTPDNS server is unavailable for resolution, the component falls back to the system DNS server.
SECURE_ONLY2The specified HTTPDNS server is forcibly used for DNS resolution.

SecurityLevel11+

Enumerates the security levels of the web page.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NONE0The web page is neither absolutely secure nor insecure, that is, neutral. A typical example is a web page whose URL scheme is not HTTP or HTTPS.
SECURE1The web page is secure, using the HTTPS protocol and a trusted certificate.
WARNING2The web page is insecure. A typical example is a web page that uses the HTTP or HTTPS protocol but an outdated TLS version.
DANGEROUS3The web page is dangerous. This means that the page may have attempted to load HTTPS scripts to no avail, have failed authentication, or contain insecure active content in HTTPS, malware, phishing, or any other sources of major threats.

MediaPlaybackState12+

Enumerates the playback states on the current web page.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NONE0No audio or video playback is started on the page.
PLAYING1The audio and video on the page are being played.
PAUSED2The audio and video on the page are paused.
STOPPED3The audio and video on the page are stopped.

PressureLevel14+

Enumerates the memory pressure levels. When an application clears the cache occupied by the Web component, the Web kernel releases the cache based on the memory pressure level.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
MEMORY_PRESSURE_LEVEL_MODERATE1Moderate memory pressure level. At this level, the Web kernel attempts to release the cache that has low reallocation overhead and does not need to be used immediately.
MEMORY_PRESSURE_LEVEL_CRITICAL2Critical memory pressure level. At this level, the Web kernel attempts to release all possible memory caches.

WebMessageType10+

Enumerates the data types supported by the webMessagePort API.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NOT_SUPPORT0Unsupported data type.
STRING1String type.
NUMBER2Number type.
BOOLEAN3Boolean type.
ARRAY_BUFFER4Raw binary data buffer.
ARRAY5Array type.
ERROR6Error object type.

JsMessageType10+

Enumerates the data types of the results returned after the runJavaScriptExt API is executed.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NOT_SUPPORT0Unsupported data type.
STRING1String type.
NUMBER2Number type.
BOOLEAN3Boolean type.
ARRAY_BUFFER4Raw binary data buffer.
ARRAY5Array type.

RenderProcessMode12+

Enumerates the ArkWeb render subprocess modes.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
SINGLE0ArkWeb single render subprocess mode. In this mode, multiple Web components share one render subprocess.
MULTIPLE1ArkWeb multi-render subprocess mode. In this mode, each Web component has a rendering subprocess.

OfflineResourceType12+

Enumerates the offline resource types corresponding to the OfflineResourceMap object.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
IMAGE0Resource of the image type.
CSS1Resource of the CSS type.
CLASSIC_JS2Javascript resource loaded through the <script src="" /> tag.
MODULE_JS3Javascript resource loaded through the <script src="" type="module" /> tag.

ScrollType12+

Enumerates the scroll types for setScrollable.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
EVENT0Scrolling event, indicating that a web page is scrolled by using a touchscreen, a touchpad, or a mouse.

WebDownloadState11+

Enumerates the states of a download task.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
IN_PROGRESS0The download task is in progress.
COMPLETED1The download task is completed.
CANCELED2The download task has been canceled.
INTERRUPTED3The download task is interrupted.
PENDING4The download task is pending.
PAUSED5The download task is paused.
UNKNOWN6The state of the download task is unknown.

WebDownloadErrorCode11+

Enumerates the download task error codes.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
ERROR_UNKNOWN0Unknown error.
FILE_FAILED1Failed to operate the file.
FILE_ACCESS_DENIED2No permission to access the file.
FILE_NO_SPACE3The disk space is insufficient.
FILE_NAME_TOO_LONG5The file name is too long.
FILE_TOO_LARGE6The file is too large.
FILE_TRANSIENT_ERROR10Some temporary issues occur, such as insufficient memory, files in use, and too many files open at the same time.
FILE_BLOCKED11Access to the file is blocked due to certain local policies.
FILE_TOO_SHORT13The file to resume downloading is not long enough. It may not exist.
FILE_HASH_MISMATCH14Hash mismatch.
FILE_SAME_AS_SOURCE15The file already exists.
NETWORK_FAILED20Common network error.
NETWORK_TIMEOUT21Network connection timeout.
NETWORK_DISCONNECTED22Network disconnected.
NETWORK_SERVER_DOWN23The server is shut down.
NETWORK_INVALID_REQUEST24Invalid network request. The request may be redirected to an unsupported scheme or an invalid URL.
SERVER_FAILED30The server returns a general error.
SERVER_NO_RANGE31The server does not support the range request.
SERVER_BAD_CONTENT33The server does not have the requested data.
SERVER_UNAUTHORIZED34The file cannot be downloaded from the server.
SERVER_CERT_PROBLEM35The server certificate is incorrect.
SERVER_FORBIDDEN36The access to the server is forbidden.
SERVER_UNREACHABLE37The server cannot be accessed.
SERVER_CONTENT_LENGTH_MISMATCH38The received data does not match the content length.
SERVER_CROSS_ORIGIN_REDIRECT39An unexpected cross-site redirection occurs.
USER_CANCELED40The user cancels the download.
USER_SHUTDOWN41The user closes the application.
CRASH50The application crashes.

WebResourceType12+

Enumerates the types of requested resources.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
MAIN_FRAME0Top-level page.
SUB_FRAME1Frame or Iframe.
STYLE_SHEET2CSS style sheet.
SCRIPT3External script.
IMAGE4Image (JPG, GIF, PNG, or other format).
FONT_RESOURCE5Font.
SUB_RESOURCE6Other sub-resource. If the type is unknown, it is used as the default type.
OBJECT7Object (or embed) tag of the plug-in, or the resource requested by the plug-in.
MEDIA8Media resource.
WORKER9Main resource of a dedicated worker thread.
SHARED_WORKER10Main resource of a shared worker thread.
PREFETCH11Explicit prefetch request.
FAVICON12Website icon.
XHR13XMLHttpRequest.
PING14<a ping>/sendBeacon ping request.
SERVICE_WORKER15Main resource of a service worker.
CSP_REPORT16Report of Content Security Policy violation.
PLUGIN_RESOURCE17Resource requested by the plug-in.
NAVIGATION_PRELOAD_MAIN_FRAME19Main frame redirection request that triggers service worker preloading.
NAVIGATION_PRELOAD_SUB_FRAME20Subframe redirection request that triggers service worker preloading.

PlaybackStatus12+

Enumerates the playback statuses of the player, which is an input parameter of the handleStatusChanged API.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
PAUSED0Playing.
PLAYING1Paused.

NetworkState12+

Enumerates the network statuses of the player.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
EMPTY0The player has not started downloading data.
IDLE1The player's network activity is idle. This could mean that the download of a media segment is complete, and the player is waiting to start downloading the next segment.
LOADING2The player is downloading media data.
NETWORK_ERROR3A network error occurs.

ReadyState12+

Enumerates the cache states of the player.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
HAVE_NOTHING0There is no data cached.
HAVE_METADATA1Only media metadata is cached.
HAVE_CURRENT_DATA2Data up to the current playback position is cached.
HAVE_FUTURE_DATA3Data beyond the current playback position is cached, but there might still be stutters during playback.
HAVE_ENOUGH_DATA4Sufficient data has been cached to ensure smooth playback.

MediaError12+

Enumerates the error types of the player.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NETWORK_ERROR1Network error.
FORMAT_ERROR2Media format error.
DECODE_ERROR3Decoding error.

SuspendType12+

Enumerates the suspension types of the player.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
ENTER_BACK_FORWARD_CACHE0The page enters the BFCache.
ENTER_BACKGROUND1The page is displayed in the background.
AUTO_CLEANUP2The page is automatically cleaned up by the system.

MediaType12+

Enumerates the media types.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
VIDEO0Video.
AUDIO1Audio.

SourceType12+

Enumerates the media source types.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
URL0URL.
MSE1Blob.

Preload12+

Enumerates how the player preloads media data.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NONE0No media data is preloaded.
METADATA1Only the metadata of the media is preloaded.
AUTO2A sufficient amount of media data is preloaded to ensure smooth playback

ProxySchemeFilter15+

Enumerates the schemes that use the proxy.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
MATCH_ALL_SCHEMES0All schemes use proxies.
MATCH_HTTP1HTTP requests use proxies.
MATCH_HTTPS2HTTPS requests use proxies.

WebDestroyMode20+

Enumerates the destroy modes of the Web component. When the Web component is destroyed, the destroy mode affects the resource release time of the Web kernel, such as the JavaScript running context and rendering context.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NORMAL_MODE0Normal mode. The system determines the destroy time of Web component resources.
FAST_MODE1Quick mode. When the Web component is destroyed, the related internal resources are destroyed immediately.

ScrollbarMode23+

Enumerates the global scrollbar modes in the web page.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
OVERLAY_LAYOUT_SCROLLBAR0The scrollbar is not always displayed.
FORCE_DISPLAY_SCROLLBAR1The scrollbar is always displayed.

WebBlanklessErrorCode20+

Enumerates the error codes of the blankless loading.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
SUCCESS0Operation successful.
ERR_UNKNOWN-1Unknown error or internal status error.
ERR_INVALID_PARAM-2Invalid parameter.
ERR_CONTROLLER_NOT_INITED-3WebViewController is not bound to any component.
ERR_KEY_NOT_MATCH-4No key value is matched. setBlanklessLoadingWithKey must be used with getBlanklessInfoWithKey and their key values must be the same. Otherwise, this error code is returned.
ERR_SIGNIFICANT_CHANGE-5The similarity is low, and the system determines that the scene change is too large. As a result, the setBlanklessLoadingWithKey API does not enable frame interpolation.
ERR_DURATION_OUT_OF_RANGE23+-6The frame interpolation duration set in BlanklessLoadingParam is out of range.
Model restriction: This API can be used only in the stage model.
ERR_EXPIRATION_TIME_OUT_OF_RANGE23+-7The historical frame expiration time set in BlanklessLoadingParam is out of range.
Model restriction: This API can be used only in the stage model.

BlanklessFrameInterpolationState 23+

Frame interpolation status of blankless loading.

System capability: SystemCapability.Web.Webview.Core

Model restriction: This API can be used only in the stage model.

NameValueDescription
FRAME_INTERPOLATION_SUCCEEDED0Frame interpolation succeeded.
FRAME_INTERPOLATION_FAILED1Frame interpolation failed.
FRAME_INTERPOLATION_REMOVED2The frame interpolation is removed.

ArkWebEngineVersion20+

For details about the ArkWeb kernel version, see Adaptation Guide for the M114 Kernel on OpenHarmony 6.0.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
SYSTEM_DEFAULT0Default system kernel. For OpenHarmony 6.0, the default kernel is M132.
M1141Legacy kernel of OpenHarmony 6.0. You can select this legacy kernel. If it does not exist, the setting is invalid.
M1322Evergreen kernel of OpenHarmony 6.0, which is M132 by default. If it does not exist, the setting is invalid.
ARKWEB_EVERGREEN23+99999Evergreen kernel, which is the latest kernel of the system. You can choose to use the latest kernel for each system version. This setting takes effect for OpenHarmony 6.1 and later versions.

Table 1 Description of evergreen kernel and legacy kernel

Kernel TypeNameDescription
Evergreen kernelEVERGREEN WebCoreLatest Web kernel of the system, based on which the complete functionalities are implemented. This kernel is recommended for applications.
Legacy kernelLEGACY WebCoreA previous-release kernel that receives only security and PR-related fixes, used solely for compatibility rollback, and is supported for a fixed duration only.

SiteIsolationMode21+

Enumerates the site isolation modes. The site isolation mechanism isolates websites from different sources in different render processes to reduce the cross-domain attack surface. For example, on a PC, each tab corresponds to a render process. After site isolation is enabled, Iframes from different sources run in independent render processes.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
PARTIAL0Partial site isolation. New sites are loaded in the same render process.
STRICT1Strict site isolation. Iframes from different sites are switched to new render processes.

WebSoftKeyboardBehaviorMode22+

Enumerates the behavior modes of the web soft keyboard.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
DEFAULT0When the Web component is focused or unfocused, or its status changes to inactive or active, the system attempts to hide or display the soft keyboard. This value is used by default.
DISABLE_AUTO_KEYBOARD_ON_ACTIVE1When the Web component's status changes between inactive and active, the system does not hide or start the soft keyboard.

WebHttpCookieSameSitePolicy23+

Enumerates the policies for sending cookies in cross-site requests.

System capability: SystemCapability.Web.Webview.Core

NameValueDescription
NONE0Cookies can be carried in cross-site requests, but the secure attribute must be set.
LAX1Cookies can be carried in specific cross-site requests, such as navigation scenarios of some GET requests.
STRICT2Cookies cannot be carried in cross-site requests.

UserAgentFormFactor24+

Enumerates the user device forms.

System capability: SystemCapability.Web.Webview.Core

Model restriction: This API can be used only in the stage model.

NameValueDescription
AUTOMOTIVE'Automotive'Telematics device, which is a string.
DESKTOP'Desktop'PC, which is a string.
MOBILE'Mobile'Mobile phone, which is a string.
EINK'EInk'E-ink screen, which is a string.
TABLET'Tablet'Tablet, which is a string.
WATCH'Watch'Watch, which is a string.
XR'XR'VR+AR device, which is a string.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-webview-WebviewController

openharmony 鸿蒙 arkts-apis-webview-t

openharmony 鸿蒙 arkts-apis-webview

openharmony 鸿蒙 capi-arkweb-type-h

openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler

openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager

openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler

openharmony 鸿蒙 capi-web-arkweb-webmessage8h

openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/vJODtDv2