openharmony 鸿蒙 arkts-apis-webview-WebSchemeHandlerRequest

2026-08-25 浏览 (1)

Class (WebSchemeHandlerRequest)

Represents a request intercepted by the WebSchemeHandler object.

NOTE

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

  • The initial APIs of this class are supported since API version 12.

  • The sample effect is subject to the actual device.

getHeader12+

getHeader(): Array<WebHeader>

Obtains the information about the resource request header.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
Array<WebHeader>Information about the resource request header.

Example

For the complete sample code, see onRequestStart.

getRequestUrl12+

getRequestUrl(): string

Obtains the URL of the resource request.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringURL of the resource request.

Example

For the complete sample code, see onRequestStart.

getRequestMethod12+

getRequestMethod(): string

Obtains the request method.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringRequest method.

Example

For the complete sample code, see onRequestStart.

getReferrer12+

getReferrer(): string

Obtains the referrer.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringObtained referrer.

Example

For the complete sample code, see onRequestStart.

isMainFrame12+

isMainFrame(): boolean

Checks whether the resource request is for the main frame.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
booleanWhether the resource request is for the main frame. If the resource request is for the main frame, true is returned. Otherwise, false is returned.

Example

For the complete sample code, see onRequestStart.

hasGesture12+

hasGesture(): boolean

Checks whether the resource request is associated with a gesture (for example, a tap).

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
booleanWhether the resource request is associated with a gesture (for example, a tap). If the resource request is associated with a gesture, true is returned. Otherwise, false is returned.

Example

For the complete sample code, see onRequestStart.

getHttpBodyStream12+

getHttpBodyStream(): WebHttpBodyStream|null

Obtains the WebHttpBodyStream instance in this resource request.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
WebHttpBodyStream |nullWebHttpBodyStream instance in the resource request. If there is no WebHttpBodyStream instance, null is returned.

Example

For the complete sample code, see onRequestStart.

getRequestResourceType12+

getRequestResourceType(): WebResourceType

Obtains the resource type of this resource request.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
WebResourceTypeResource type of the resource request.

Example

For the complete sample code, see onRequestStart.

getFrameUrl12+

getFrameUrl(): string

Obtains the URL of the frame that triggers this request.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringURL of the frame that triggers the request.

Example

For the complete sample code, see onRequestStart.

你可能感兴趣的鸿蒙文章

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