openharmony 鸿蒙 arkts-apis-webview-UserAgentBrandVersion

2026-08-25 浏览 (1)

Class (UserAgentBrandVersion)

This class provides APIs for configuring UserAgentBrandVersion.

NOTE

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

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

  • The sample effect is subject to the actual device.

setBrand

setBrand(brand: string): void

Sets the brand name.

System capability: SystemCapability.Web.Webview.Core

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

Parameters

NameTypeMandatoryDescription
brandstringYesBrand name, which cannot be an empty string.

Example

For details about the sample code, see setUserAgentClientHintsEnabled.

getBrand

getBrand(): string

Obtains the brand name.

System capability: SystemCapability.Web.Webview.Core

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

Return value

TypeDescription
stringBrand name.

Example

For details about the sample code, see setUserAgentClientHintsEnabled.

setMajorVersion

setMajorVersion(majorVersion: string): void

Sets the major version number.

System capability: SystemCapability.Web.Webview.Core

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

Parameters

NameTypeMandatoryDescription
majorVersionstringYesMajor version number, which cannot be an empty string.

Example

For details about the sample code, see setUserAgentClientHintsEnabled.

getMajorVersion

getMajorVersion(): string

Obtains the major version number.

System capability: SystemCapability.Web.Webview.Core

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

Return value

TypeDescription
stringMajor version number.

Example

For details about the sample code, see setUserAgentClientHintsEnabled.

setFullVersion

setFullVersion(fullVersion: string): void

Sets the full version number.

System capability: SystemCapability.Web.Webview.Core

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

Parameters

NameTypeMandatoryDescription
fullVersionstringYesFull version number, which cannot be an empty string.

Example

For details about the sample code, see setUserAgentClientHintsEnabled.

getFullVersion

getFullVersion(): string

Obtains the full version number.

System capability: SystemCapability.Web.Webview.Core

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

Return value

TypeDescription
stringFull version number.

Example

For details about the sample code, see setUserAgentClientHintsEnabled.

你可能感兴趣的鸿蒙文章

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