Class (ControllerHandler)

Implements a WebviewController object for new Web components. For details about the sample code, see onWindowNew.

NOTE

  • 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.

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

  • The sample effect is subject to the actual device.

constructor9+

constructor()

Constructs a ControllerHandler API.

System capability: SystemCapability.Web.Webview.Core

setWebController9+

setWebController(controller: WebviewController): void

Sets a WebviewController object. If opening a new window is not needed, set the parameter to null.

System capability: SystemCapability.Web.Webview.Core

Parameters

Name Type Mandatory Description
controller WebviewController Yes WebviewController object of the Web component. If opening a new window is not needed, set it to null.