1# Class (ControllerHandler) 2<!--Kit: ArkWeb--> 3<!--Subsystem: Web--> 4<!--Owner: @weixin_41848015--> 5<!--Designer: @libing23232323--> 6<!--Tester: @ghiker--> 7<!--Adviser: @HelloCrease--> 8 9设置用户新建Web组件的WebviewController对象。示例代码参考[onWindowNew事件](./arkts-basic-components-web-events.md#onwindownew9)。 10 11> **说明:** 12> 13> - 该组件首批接口从API version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 14> 15> - 本Class首批接口从API version 9开始支持。 16> 17> - 示例效果请以真机运行为准,当前DevEco Studio预览器不支持。 18 19**系统能力:** SystemCapability.Web.Webview.Core 20 21## constructor<sup>9+</sup> 22 23constructor() 24 25ControllerHandler的构造函数。 26 27**系统能力:** SystemCapability.Web.Webview.Core 28 29## setWebController<sup>9+</sup> 30 31setWebController(controller: WebviewController): void 32 33设置WebviewController对象,如果不需要打开新窗口请设置为null。 34 35**系统能力:** SystemCapability.Web.Webview.Core 36 37**参数:** 38 39| 参数名 | 类型 | 必填 | 说明 | 40| ---------- | ---------------------------------------- | ---- | ---------------------------------------- | 41| controller | [WebviewController](./arkts-apis-webview-WebviewController.md) | 是 | 新建Web组件的WebviewController对象,如果不需要打开新窗口请设置为null。 |