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

2026-08-25 浏览 (1)

Interfaces (Others)

NOTE

  • This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.

  • The sample effect is subject to the actual device.

WebOptions

Defines web options through the APIs.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
srcstring |ResourceNoNoAddress of a web page resource. To access local resource files, use the $rawfile or resource protocol. To load a local resource file (in HTML or TXT format) in the sandbox outside of the application package, use file:// to specify the path of the sandbox.
src cannot be dynamically changed through a state variable (for example, @State). To change the value, call loadUrl().
controllerWebController |WebviewControllerNoNoController that controls various behaviors of Web components, including page navigation, declaration period status, and JavaScript interaction. WebController is deprecated since API version 9. You are advised to use WebviewController instead.
renderMode12+RenderModeNoYesRendering mode.
RenderMode.ASYNC_RENDER (default, cannot be dynamically adjusted): The Web component is rendered asynchronously.
RenderMode.SYNC_RENDER: The Web component is rendered synchronously.
incognitoMode11+booleanNoYesWhether to enable incognito mode. The value true means to enable incognito mode, and false means the opposite.
Default value: false.
If undefined or null is passed, the value is false.
sharedRenderProcessToken12+stringNoYesToken of the shared rendering process specified by the Web component. In multi-rendering process mode, the Web component with the same token preferentially attempts to reuse the rendering process bound to the token. The token is bound to the rendering process when the rendering process is initialized. When the rendering process is not associated with a Web component, its binding to the token is removed.
Default value: "".
emulateTouchFromMouseEvent22+booleanNoYesWhether to convert mouse events into touch events.
Default value: false.

WebMediaOptions10+

Describes the web media options.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
resumeIntervalnumberNoYesValidity period for automatically resuming a web audio paused by another application, in seconds. The value range is [-2147483648, 2147483647]. If resumeInterval is set to 0, the playback is not automatically resumed. If resumeInterval is set to a value greater than 0, the playback is resumed in the specified period. If resumeInterval is set to a value less than 0, the playback is resumed in an unlimited period. Due to the approximate value, the validity period may have a deviation of less than 1 second.
NOTE
After an HLS video is interrupted, the video playback is automatically resumed when the video is returned to the foreground.
audioExclusivebooleanNoYesWhether the audio of multiple Web instances in an application is exclusive.
The value true indicates that the audio of multiple Web instances in an application is exclusive, and false indicates the opposite.
The default value is true.
audioSessionType20+AudioSessionTypeNoYesWeb audio type in the application. The default value is STREAM_USAGE_MUSIC. This parameter changes the mapping between the component audio type and the system audio type, which affects the ArkWeb audio focus policy.

ScriptItem11+

Describes the ScriptItem object registered with the Web component through the javaScriptOnDocumentStart attribute.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
scriptstringNoNoJavaScript script to be registered and executed.
scriptRulesArray<string>NoNoMatching rules for allowed sources.
1. To allow URLs from all sources, use the wildcard (*).
2. If exact match is required, specify the exact URL, for example, https://www.example.com.
3. For fuzzy match, you can use a wildcard (*) in the website URL, for example, https://*.example.com. Websites such as "x,.y.com" and " foobar.com" are not allowed.
4. If the source is an IP address, follow rule 2.
5. For protocols other than HTTP/HTTPS (custom protocols), exact match and fuzzy match are not supported, and the protocol must end with ://, for example, resource://.
6. If one of the preceding rules is not met in scriptRules, the scriptRules does not take effect.
urlRegexRules23+Array<UrlRegexRule>NoYesRegular expression matching rules for allowed sources. urlRegexRules is used for matching only when scriptRules is set to [].
Model restriction: This API can be used only in the stage model.

UrlRegexRule23+

Defines the URL regular expression rule.

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

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
secondLevelDomainstringNoNoExact match of the second-level domain. For example, the second-level domain name of "https://www.example.com" is example.com, and that of "https://www.example.com.cn" is example.com.cn. If the URL does not have a second-level domain name, the value is empty.
rulestringNoNoURL regular expression. URL regular expression matching is performed only after secondLevelDomain is matched successfully.

NestedScrollOptionsExt14+

Implements a NestedScrollOptionsExt object to set up, down, left, and right nested scrolling options.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
scrollUpNestedScrollModeNoYesNested scrolling options when the component scrolls up.
Default value: NestedScrollMode.SELF_FIRST.
scrollDownNestedScrollModeNoYesNested scrolling options when the component scrolls down.
Default value: NestedScrollMode.SELF_FIRST.
scrollLeftNestedScrollModeNoYesNested scrolling options when the component scrolls left.
Default value: NestedScrollMode.SELF_FIRST.
scrollRightNestedScrollModeNoYesNested scrolling options when the component scrolls right.
Default value: NestedScrollMode.SELF_FIRST.

NativeMediaPlayerConfig12+

Represents the configuration for enabling the application to take over web page media playback.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
enablebooleanNoNoWhether to enable the application to take over web page media playback.
The value true means to enable the application to take over web page media playback, and false means the opposite.
Default value: false.
shouldOverlaybooleanNoNoWhether the video player's display overlays the web page content when the application takes over the web page's video player.
The value true indicates that the video player's display overlays the web page content. This means that the height of the video layer is adjusted to cover the web page content. The value false indicates that the video player's display does not overlay the web page content. This means that the video player maintains its original height and is embedded within the web page.
Default value: false.

ExpandedMenuItemOptions(deprecated)

NOTE

This API is supported from API version 12 and deprecated from API version 20. You are advised to use editMenuOptions instead. Represents the custom expanded menu item options.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
contentResourceStrNoNoDisplay content.
startIconResourceStrNoYesDisplay icon. The default value is empty, and no icon is displayed.
action(selectedText: {plainText: string}) => voidNoNoSelected text.

AdsBlockedDetails12+

Provides detailed information about the blocked ads when ads are blocked.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page where ads are blocked.
adsBlockedArray<string>NoNoURLs or dompaths of the blocked ads. If multiple ads have the same URLs, duplicate elements may exist.

SelectionMenuOptionsExt13+

Represents the selection menu option extension.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
onAppearCallback<void>NoYesCallback invoked when the custom selection menu appears.
onDisappearCallback<void>NoYesCallback invoked when the custom selection menu disappears.
previewCustomBuilderNoYesPreview content style of the custom selection menu. If this parameter is not set, there is no preview content.
menuTypeMenuTypeNoYesType of the custom selection menu.
Default value: MenuType.SELECTION_MENU
Since API version 20, MenuType.PREVIEW_MENU supports hyperlink preview.
previewMenuOptions20+PreviewMenuOptionsNoYesCustom preview menu options.
onMenuShow21+Callback<void>NoYesCallback invoked when the custom context menu on selection is shown.
onMenuHide21+Callback<void>NoYesCallback invoked when the custom context menu on selection is hidden.

PreviewMenuOptions20+

Represents the options of the preview menu.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
hapticFeedbackModeHapticFeedbackModeNoYesVibration effect when the menu is displayed. The ohos.permission.VIBRATE permission is required.
Default value: HapticFeedbackMode.DISABLED, indicating no vibration when the menu is displayed.

EmbedOptions16+

Represents the same-layer rendering configuration of the Web component.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
supportDefaultIntrinsicSizebooleanNoYesWhether a same-layer rendering element supports the fixed size of 300 × 150.
When the size of an element is set using CSS on the HTML5 side, the size of the same-layer rendering element uses the CSS size. Otherwise, the size is fixed.
If the value is true, the fixed size is 300 × 150.
If the value is false and the CSS size is not set on the HTML5 side, the same-layer rendering elements are not rendered.
Default value: false.
Unit: px.
supportCssDisplayChange20+booleanNoYesWhether the same-layer rendering visibility API supports the display attribute.
By default, the visibility status of same-layer tags relative to the viewport is supported.
If this attribute is set to true, CSS attributes can be displayed, including visibility, display, width, and height.
Otherwise, CSS attributes are not displayed, and only same-layer tags are visible relative to the viewport.

OnAlertEvent12+

Defines the callback used when a web page triggers alert().

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the web page where the dialog box is displayed.
messagestringNoNoInformation displayed in the dialog box.
resultJsResultNoNoUser operation result that is notified to the Web component.

OnBeforeUnloadEvent12+

Represents the callback invoked when this page is about to exit after the user refreshes or closes the page.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the web page where the dialog box is displayed.
messagestringNoNoMessage displayed in the dialog box.
resultJsResultNoNoUser operation.
isReload20+booleanNoYesWhether the page is refreshed.
The value true indicates that the page is about to leave due to refreshing, and false indicates that the page is about to leave due to closing.
Default value: false.

OnConfirmEvent12+

Defines the callback used when a web page triggers confirm().

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the web page where the dialog box is displayed.
messagestringNoNoInformation displayed in the dialog box.
resultJsResultNoNoUser operation result that is notified to the Web component.

OnPromptEvent12+

Defines the callback used when a web page triggers prompt().

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the web page where the dialog box is displayed.
messagestringNoNoInformation displayed in the dialog box.
valuestringNoNoDefault information returned by the dialog box.
resultJsResultNoNoUser operation result that is notified to the Web component.

OnConsoleEvent12+

Represents the callback invoked to notify the host application of a JavaScript console message.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
messageConsoleMessageNoNoConsole message.

OnErrorReceiveEvent12+

Represents the callback triggered when an error occurs during web page loading.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
requestWebResourceRequestNoNoEncapsulation of a web page request.
errorWebResourceErrorNoNoEncapsulation of a web page resource loading error.

OnHttpErrorReceiveEvent12+

Represents the callback triggered when an HTTP error occurs during web page resource loading.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
requestWebResourceRequestNoNoEncapsulation of a web page request.
responseWebResourceResponseNoNoEncapsulation of a resource response.

OnDownloadStartEvent12+

Represents the callback invoked when the host application starts downloading a file.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL for the download task.
userAgentstringNoNoUser agent used for download.
contentDispositionstringNoNoContent-Disposition response header returned by the server, which may be empty.
mimetypestringNoNoMIME type of the content returned by the server.
contentLengthnumberNoNoLength of the content returned by the server.

OnRefreshAccessedHistoryEvent12+

Defines the callback triggered when the navigation is complete.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL to be accessed.
isRefreshedbooleanNoNoWhether the page is reloaded. The value true means that the page is reloaded by invoking the refresh9+ API, and false means the opposite.
isMainFrame22+booleanNoYesWhether the event is triggered by the main frame.
The value true indicates that the event is triggered by the main frame, and false indicates the opposite.

OnRenderExitedEvent12+

Represents the callback invoked when the rendering process exits.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
renderExitReasonRenderExitReasonNoNoCause for the abnormal exit of the rendering process.

OnShowFileSelectorEvent12+

Represents the callback invoked to notify the file selector result.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
resultFileSelectorResultNoNoFile selection result to be sent to the Web component.
fileSelectorFileSelectorParamNoNoInformation about the file selector.

OnResourceLoadEvent12+

Represents the callback invoked when the URL is loaded.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the loaded resource file.

OnScaleChangeEvent12+

Represents the callback invoked when the display scale of this page changes.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
oldScalenumberNoNoDisplay scale of the page before the change.
newScalenumberNoNoDisplay scale of the page after the change.

OnHttpAuthRequestEvent12+

Represents the callback invoked when an HTTP authentication request is received.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerHttpAuthHandlerNoNoUser operation.
hoststringNoNoHost to which the HTTP authentication credential is applied.
realmstringNoNoRealm to which the HTTP authentication credential is applied.

OnInterceptRequestEvent12+

Represents the callback invoked when the Web component is about to load a URL.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
requestWebResourceRequestNoNoInformation about the URL request.

OnPermissionRequestEvent12+

Represents the callback invoked when a permission request is received.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
requestPermissionRequestNoNoUser operation.

OnScreenCaptureRequestEvent12+

Represents the callback invoked when a screen capture request is received.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerScreenCaptureHandlerNoNoUser operation.

OnContextMenuShowEvent12+

Represents the callback invoked during a call to allow for the display of a custom context menu.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
paramWebContextMenuParamNoNoParameters related to the context menu.
resultWebContextMenuResultNoNoResult of the context menu.

OnSearchResultReceiveEvent12+

Represents the callback invoked to notify the caller of the search result on the web page.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
activeMatchOrdinalnumberNoNoSequence number of the current match, which starts from 0.
numberOfMatchesnumberNoNoTotal number of matches.
isDoneCountingbooleanNoNoWhether the search operation on the current page is complete.
The value true indicates that the search operation on the current page is complete, and false indicates the opposite.
This API may be called multiple times until isDoneCounting is true.

OnScrollEvent12+

Represents the callback invoked when the scrollbar scrolls to a specified position.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
xOffsetnumberNoNoPosition of the scrollbar on the x-axis relative to the leftmost of the web page.
Unit: vp.
yOffsetnumberNoNoPosition of the scrollbar on the y-axis relative to the top of the web page.
Unit: vp.

OnSslErrorEventReceiveEvent12+

Represents the callback invoked when the web page receives an SSL error.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerSslErrorHandlerNoNoUser operation.
errorSslErrorNoNoError code.
certChainData15+Array<Uint8Array>NoYesCertificate chain data.

SslErrorEvent12+

Provides details about the callback invoked when an SSL error occurs during resource loading.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerSslErrorHandlerNoNoUser operation.
errorSslErrorNoNoError code.
urlstringNoNoURL.
originalUrlstringNoNoOriginal URL of the request.
referrerstringNoNoReferrer URL.
isFatalErrorbooleanNoNoWhether the error is a fatal error.
The value true indicates a fatal error, and false indicates a non-fatal error.
isMainFramebooleanNoNoWhether the resource is a main resource.
The value true indicates a main resource, and false indicates a non-main resource.
certChainData20+Array<Uint8Array>NoYesCertificate chain data.

OnClientAuthenticationEvent12+

Represents the callback invoked when an SSL client certificate is required from the user.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerClientAuthenticationHandlerNoNoUser operation.
hoststringNoNoHost name of the server that requests a certificate.
portnumberNoNoPort number of the server that requests a certificate.
keyTypesArray<string>NoNoAcceptable asymmetric private key types.
issuersArray<string>NoNoIssuer of the certificate that matches the private key.

VerifyPinEvent22+

Defines the callback triggered to notify the user of PIN verification.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerVerifyPinHandlerNoNoUser operation.
identitystringNoNoCertificate credential ID used for verification.

OnWindowNewEvent12+

Represents the callback invoked when the web page requests the user to create a window.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
isAlertbooleanNoNoWhether to open the target URL in a new window. The value true means to open the target URL in a new window, and false means to open the target URL in a new tab.
isUserTriggerbooleanNoNoWhether the creation is triggered by the user. The value true means that the creation is triggered by the user, and false means the opposite.
targetUrlstringNoNoTarget URL.
handlerControllerHandlerNoNoWebviewController instance for setting the new window.

WindowFeatures23+

Represents the feature information of the new window requested to be created by the web page, including the size and location.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
xnumberNoNoX coordinate of the top-left corner of the new window, in pixels.
ynumberNoNoY coordinate of the top-left corner of the new window, in pixels.
widthnumberNoNoWidth of the new window, in pixels.
heightnumberNoNoHeight of the new window, in pixels.

OnWindowNewExtEvent23+

Defines the callback invoked when the web page requests the user to create a window.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
isAlertbooleanNoNoThe value true indicates that a dialog box is requested to be created, and the value false indicates that a new tab page is requested to be created.
isUserTriggerbooleanNoNoWhether the creation is triggered by the user. The value true means that the creation is triggered by the user, and false means the opposite.
targetUrlstringNoNoURL to be opened in the new window.
handlerControllerHandlerNoNoWebviewController instance for setting the new window.
windowFeaturesWindowFeaturesNoNoFeature information of the new window requested to be created by the web page.
navigationPolicyNavigationPolicyNoNoWindow opening mode when the web page requests a user to create a new window.

OnTouchIconUrlReceivedEvent12+

Represents the callback invoked when an apple-touch-icon URL is received.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoReceived apple-touch-icon URL.
precomposedbooleanNoNoWhether the apple-touch-icon is precomposed.
true indicates that the apple-touch-icon is precomposed, and false indicates the opposite.

OnFaviconReceivedEvent12+

Represents the callback invoked when this web page receives a new favicon.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
faviconPixelMapNoNoPixelMap object of the received favicon.

OnPageVisibleEvent12+

Represents the callback invoked when the old page is not displayed and the new page is about to be visible.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the new page that is able to be visible when the old page is not displayed.

OnDataResubmittedEvent12+

Represents the callback invoked when the web form data can be resubmitted.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerDataResubmissionHandlerNoNoHandler for resubmitting web form data.

OnAudioStateChangedEvent12+

Represents the callback invoked when the audio playback status on the web page changes.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
playingbooleanNoNoAudio playback status on the current page. The value true means that audio is being played, and false means the opposite.

OnFirstContentfulPaintEvent12+

Represents the callback invoked when the first content paint occurs on the web page.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
navigationStartTicknumberNoNoNavigation start time, in microseconds.
firstContentfulPaintMsnumberNoNoTime between navigation and when the content is first rendered, in milliseconds.

OnLoadInterceptEvent12+

Represents the callback invoked when the Web component is about to access a URL.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
dataWebResourceRequestNoNoInformation about the URL request.

OnOverScrollEvent12+

Represents the callback invoked when the web page is overscrolled.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
xOffsetnumberNoNoHorizontal overscroll offset based on the leftmost edge of the web page.
Unit: vp.
yOffsetnumberNoNoVertical overscroll offset based on the top edge of the web page.
Unit: vp.

JavaScriptProxy12+

Represents the JavaScript object to be injected.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
objectobjectNoNoObject to be registered. Methods can be declared, but attributes cannot.
namestringNoNoName of the object to be registered, which is the same as that invoked in the window.
methodListArray<string>NoNoSynchronous methods of the JavaScript object to be registered at the application side.
controllerWebController |WebviewController9+NoNoController. This API is deprecated since API version 9. You are advised to use WebviewController instead.
asyncMethodList12+Array<string>NoYesAsynchronous methods of the JavaScript object to be registered at the application side. Asynchronous methods cannot obtain return values.
permission12+stringNoYesJSON string, which is empty by default. This string is used to configure JSBridge permission control and define the URL trustlist at the object and method levels.
The permission parameter of JavaScriptProxy supports the resource, HTTP, and HTTPS protocols, but does not support the file protocol.
For the example, see Invoking Application Functions on the Frontend Page.

OnPageEndEvent12+

Represents the callback invoked when the web page loading ends.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page.

OnPageBeginEvent12+

Represents the callback invoked when the web page loading begins.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page.

OnProgressChangeEvent12+

Represents the callback invoked when the web page loading progress changes.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
newProgressnumberNoNoNew loading progress. The value is an integer ranging from 0 to 100.

OnTitleReceiveEvent12+

Represents the callback invoked when the document title of the web page is changed.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
titlestringNoNoDocument title.
isRealTitle20+booleanNoYesWhether the document title is a real title. The value true indicates that the title is from the title tag of the web page, and false indicates that the title is automatically generated based on the URL.
Default value: false.

OnGeolocationShowEvent12+

Represents the callback invoked when a request to obtain the geolocation information is received.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
originstringNoNoIndex of the origin.
geolocationJsGeolocationNoNoUser operation.

NativeEmbedVisibilityInfo12+

Provides visibility information about the same-layer tag.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
visibilitybooleanNoNoWhether the same-layer tag is visible.
The value true indicates that the same-layer tag is visible, and false indicates the opposite.
embedIdstringNoNoID of the same-layer rendered tag.

RenderProcessNotRespondingData12+

Provides detailed information about the unresponsive rendering process.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
jsStackstringNoNoJavaScript call stack information of the web page.
pidnumberNoNoProcess ID of the web page.
reasonRenderProcessNotRespondingReasonNoNoReason why the rendering process does not respond.

FullScreenEnterEvent12+

Provides details about the event that the Web component to enter the full-screen mode.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
handlerFullScreenExitHandlerNoNoFunction handle for exiting full screen mode.
videoWidthnumberNoYesVideo width, in px. If the element that enters fulls screen mode is a <video> element, the value represents its width; if the element that enters fulls screen mode contains a <video> element, the value represents the width of the first sub-video element; in other cases, the value is 0.
videoHeightnumberNoYesVideo height, in px. If the element that enters fulls screen mode is a <video> element, the value represents its height; if the element that enters fulls screen mode contains a <video> element, the value represents the height of the first sub-video element; in other cases, the value is 0.

LoadCommittedDetails11+

Provides detailed information about the web page that has been submitted for redirection.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
isMainFramebooleanNoNoWhether the document is the main document.
The value true indicates that the document is the main document, and false indicates the opposite.
isSameDocumentbooleanNoNoWhether to navigate without changing the document.
The value true means to navigate without changing the document, and false means the opposite.
Example of navigation in the same document: 1. navigation shown in the example; 2. navigation triggered by pushState or replaceState; 3. navigation to a history entry on the same page.
didReplaceEntrybooleanNoNoWhether the submitted new entry replaces the existing entry.
The value true indicates that the submitted new entry replaces the existing entry, and false indicates the opposite.
In certain scenarios for navigation to a subdocument, although the existing entry is not replaced, some attributes are changed.
navigationTypeWebNavigationTypeNoNoNavigation type.
urlstringNoNoURL of the current navigated-to web page.

NativeEmbedInfo11+

Provides detailed information about the same-layer tag.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
idstringNoYesID of the same-layer tag.
typestringNoYesType of the same-layer tag. The value is in lowercase.
srcstringNoYessrc information of the same-layer tag.
widthnumberNoYesWidth of the same-layer tag, in px.
heightnumberNoYesHeight of the same-layer tag, in px.
urlstringNoYesURL of the same-layer tag.
tag12+stringNoYesTag name, which is in uppercase.
params12+Map<string, string>NoYesList of key-value pairs contained in the object tag that form a map of the Object type. Use the methods provided by the Object type, such as embed.info?.param?.["name"] to operate the map object.
position12+PositionNoYesPosition of the same-layer tag relative to the upper left corner of the Web component as the coordinate origin, in pixels. This position is different from the standard position.

NativeEmbedParamItem21+

Provides details about the param element embedded in the same-layer rendering tag object.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
statusNativeEmbedParamStatusNoNoStatus change type of the param element.
idstringNoNoID of the param element.
namestringNoYesName of the param element.
valuestringNoYesValue of the param element.

IntelligentTrackingPreventionDetails12+

Provides detailed information about intelligent tracking prevention.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
hoststringNoNoHost name.
trackerHoststringNoNoHost name of the tracker.

WebKeyboardCallbackInfo12+

Represents input parameters of the callback used to intercept the soft keyboard started from editable elements on a web page, including WebKeyboardController and editable element attributes.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
controllerWebKeyboardControllerNoNoController used to control the input, deletion, and closure of the custom keyboard.
attributesRecord<string, string>NoNoAttribute of the web page element that triggers the display of the soft keyboard.

WebKeyboardOptions12+

Represents the return value of the callback that intercepts the soft keyboard started from editable elements on the web page. You can specify the types of the keyboard, and return the value to the Web kernel to control the startup of different types of soft keyboards.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
useSystemKeyboardbooleanNoNoWhether to use the system's default soft keyboard.
The value true means to use the system's default soft keyboard, and false means the opposite.
Default value: true.
enterKeyTypenumberNoYesType of the Enter key on the system soft keyboard. For details about the value range, see EnterKeyType. This parameter is optional and the default value is UNSPECIFIED. This parameter is valid only when useSystemKeyboard is set to true and enterKeyType is set to a valid value.
customKeyboardCustomBuilderNoYesBuilder of a custom keyboard. This parameter is required when useSystemKeyboard is set to false. After it is set, the Web component starts the custom keyboard as configured.

FirstMeaningfulPaint12+

Provides detailed information about the first meaningful paint.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
navigationStartTimenumberNoYesStart time of the navigation, in microseconds.
firstMeaningfulPaintTimenumberNoYesTime taken for the first meaningful paint of the page, in milliseconds.

LargestContentfulPaint12+

Provides detailed information about the largest contentful paint.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
navigationStartTimenumberNoYesStart time of the navigation, in microseconds.
largestImagePaintTimenumberNoYesLoading time of the maximum image, in milliseconds.
largestTextPaintTimenumberNoYesLoading time of the maximum text, in milliseconds.
largestImageLoadStartTimenumberNoYesStart time of the loading of the maximum image, in milliseconds.
largestImageLoadEndTimenumberNoYesEnd time of the loading of the maximum image, in milliseconds.
imageBPPnumberNoYesNumber of pixels of the maximum image.

NativeEmbedDataInfo11+

Provides detailed information about the changes of the same-layer tag lifecycle.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
statusNativeEmbedStatusNoYesLifecycle status of the same-layer tag.
surfaceIdstringNoYesSurface ID of the native image.
embedIdstringNoYesUnique ID of the same-layer tag.
infoNativeEmbedInfoNoYesDetailed information about the same-layer tag.

NativeEmbedTouchInfo11+

Provides touch information of the same-layer tag.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
embedIdstringNoYesUnique ID of the same-layer tag.
touchEventTouchEventNoYesTouch action information.
result12+EventResultNoYesGesture event consumption result.

NativeEmbedMouseInfo20+

Provides detailed information about clicking or touching and holding a same-layer tag using the mouse or touchpad.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
embedIdstringNoYesUnique ID of the same-layer tag.
mouseEventMouseEventNoYesInformation about clicking or touching and holding using the mouse or touchpad.
resultEventResultNoYesMouse event consumption result.

NativeEmbedParamDataInfo21+

Provides details about the same-layer tag when the param element embedded in the object tag changes.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
embedIdstringNoNoUnique ID of the same-layer tag.
objectAttributeIdstringNoYesID of the same-layer tag.
paramItemsArray<NativeEmbedParamItem>NoYesDetails of the changed param element, including the status change type, ID, name, and value of each param element.

OnLoadStartedEvent20+

Represents the callback invoked when the web page loading begins.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page.

OnLoadFinishedEvent20+

Represents the callback invoked when the web page loading ends.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page.

OnPdfLoadEvent20+

Defines the function triggered when the PDF loading is successful or fails.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page.
resultPdfLoadResultNoNoThe PDF page loading result.

OnPdfScrollEvent20+

Defines the function triggered when the PDF page is scrolled to the bottom.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page.

Header

Represents the request/response header object returned by the Web component.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
headerKeystringNoNoKey of the request or response header.
headerValuestringNoNoValue of the request or response header.

ScreenCaptureConfig10+

Provides the web screen capture configuration.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
captureModeWebCaptureModeNoNoWeb screen capture mode.

BlankScreenDetectionEventInfo22+

Defines the event information when a blank screen is detected.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the page when a blank screen is detected.
blankScreenReasonDetectedBlankScreenReasonNoNoReason for the blank screen issue, which depends on the detection method.
blankScreenDetailsBlankScreenDetailsNoYesDetails of the blank screen issue detected.
For example, if a near-blank screen issue is detected, the details contain the number of points that match the blank screen issue. Otherwise, this attribute does not exist.

BlankScreenDetails22+

Defines details of the blank screen issue detected.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
detectedContentfulNodesCountnumberNoYesThis attribute may exist when the contentful node detection policy is used and the threshold for the number of detected nodes is set. Otherwise, this attribute does not exist.
Number of contentful nodes that are detected.

BlankScreenDetectionConfig22+

Defines the configuration options of the blank screen detection policy.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
enablebooleanNoNoWhether to enable the blank screen policy.
detectionTimingnumber[]NoYesInterval for checking whether a blank screen occurs after the loading, in seconds.

NOTE
1. Duplicate values are ignored.
2. The value must be greater than 0. Otherwise, the value is ignored.
Default value: [1.0, 3.0, 5.0].
detectionMethodsBlankScreenDetectionMethod[]NoYesMethods of the detection policy. The value is an array.
NOTE
1. Duplicate values are ignored.
Default value: [BlankScreenDetectionMethod.DETECTION_CONTENTFUL_NODES_SEVENTEEN].
contentfulNodesCountThresholdnumberNoYesThreshold for number of detected contentful nodes. This parameter takes effect only when the contentful node detection policy is used.
The value ranges from 0 to the maximum number of nodes in the detection policy. If the value is less than or equal to the threshold, the near-blank screen is triggered.
Default value: 0.

CameraCaptureStateChangeInfo23+

Defines the state information of the camera before and after the callback is triggered.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
originalStateCameraCaptureStateNoNoOriginal state.
newStateCameraCaptureStateNoNoNew state.

MicrophoneCaptureStateChangeInfo23+

Defines the state information of the microphone before and after the callback is triggered.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
originalStateMicrophoneCaptureStateNoNoOriginal state.
newStateMicrophoneCaptureStateNoNoNew state.

AcceptableFileType23+

Defines the file types recommended by the web page when the file selector pulls files.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
mimeTypestringNoNoMIME type of the file.
acceptableTypeArray<string>NoNoArray of acceptable file types.

FirstScreenPaint23+

Defines the event information when the first screen paint is detected.

System capability: SystemCapability.Web.Webview.Core

NameTypeRead-OnlyOptionalDescription
urlstringNoNoURL of the first screen paint statistics.
navigationStartTimenumberNoNoTime when the navigation to the page specified by url starts.
firstScreenPaintTimenumberNoNoTime when the first screen paint of the page specified url is complete.

你可能感兴趣的鸿蒙文章

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/iiPIJOB0