1# Class (ControllerHandler) 2 3Implements a **WebviewController** object for new **Web** components. For details about the sample code, see [onWindowNew](./arkts-basic-components-web-events.md#onwindownew9). 4 5> **NOTE** 6> 7> - 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. 8> 9> - The initial APIs of this class are supported since API version 9. 10> 11> - You can preview how this component looks on a real device, but not in DevEco Studio Previewer. 12 13**System capability**: SystemCapability.Web.Webview.Core 14 15## constructor<sup>9+</sup> 16 17constructor() 18 19Constructs a **ControllerHandler** API. 20 21**System capability**: SystemCapability.Web.Webview.Core 22 23## setWebController<sup>9+</sup> 24 25setWebController(controller: WebviewController): void 26 27Sets a **WebviewController** object. If opening a new window is not needed, set the parameter to **null**. 28 29**System capability**: SystemCapability.Web.Webview.Core 30 31**Parameters** 32 33| Name | Type | Mandatory| Description | 34| ---------- | ---------------------------------------- | ---- | ---------------------------------------- | 35| controller | [WebviewController](./arkts-apis-webview-WebviewController.md) | Yes | **WebviewController** object of the **Web** component. If opening a new window is not needed, set it to **null**.| 36