提交 ad3bf721 编写于 作者: E ester.zhou

Add doc (13539)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 704e08e0
# Web Subsystem ChangeLog
Compared with earlier versions, OpenHarmony 4.0.2.2 has the following API changes in its web subsystem:
## cl.web.1 Removal of webDebuggingAccess
The definition of the **webDebuggingAccess** API is inappropriate. This API should take effect for all **Web** instances. In light of this, it is removed and replaced by the new API **setWebDebuggingAccess**.
**Change Impacts**
This API must be deprecated and replaced with the **setWebDebuggingAccess** API.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|WebAttribute | method | webDebugggingAccess(webDebugggingAccess: boolean): WebAttribute| Deleted |
**Adaptation Guide**
Use the new API **setWebDebuggingAccess**.
## cl.web.2 Adding of setWebDebuggingAccess
The static API **setWebDebuggingAccess** is added to **WebviewController**. It sets whether to enable web debugging, and the setting takes effect for all **Web** instances.
**Change Impacts**
The original **webDebugggingAccess** API must be replaced with the new API in the application.
**Key API/Component Changes**
| Class| API Type| Declaration| Change Type|
| -- | -- | -- | -- |
|webview.WebviewController | method | static setWebDebugggingAccess(webDebugggingAccess: boolean): void| Added|
**Adaptation Guide**
The following exemplifies how to enable web debugging:
```ts
// xxx.ets
import web_webview from '@ohos.web.webview';
@Entry
@Component
struct WebComponent {
controller: web_webview.WebviewController = new web_webview.WebviewController();
aboutToAppear():void {
try {
web_webview.WebviewController.setWebDebuggingAccess(true);
} catch(error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
}
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
}
}
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册