• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Web Subsystem ChangeLog
2
3## cl.web.1 Deletion of Unnecessary Error Codes
4
5APIs in the webviewController component of the web subsystem are changed:
6
7 - Deleted **@throws { BusinessError } 17100007 - Invalid back or forward operation** from the **forward**, **backward**, and **backOrForward** APIs.
8 - Deleted **@throws { BusinessError } 17100009 - Cannot zoom in or zoom out** from the **zoom**, **zoomIn**, and **zoomOut** APIs.
9
10You need to adapt your application based on the following information.
11
12**Change Impacts**
13
14Released JS APIs are affected. The application can be properly compiled in the SDK environment of the new version, without any adaptation.
15
16**Key API/Component Changes**
17
18Involved APIs: **forward**, **backward**, **backOrForward**, **zoom**, **zoomIn**, and **zoomOut**
19Involved component: web
20
21**Adaptation Guide**
22
23No adaptation is required.
24## cl.web.2 setWebController Input Parameter Changes
25
26Some released web controllers are migrated to the webviewController, and the original webController is deprecated. The following changes are made in API version 9 and later:
27The input parameter of **setWebController** is replaced by the new **webviewController**.
28
29**Change Impacts**
30
31Input parameters of JS APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
32
33**Key API/Component Changes**
34
35- Involved API:
36
37  setWebController(controller: WebviewController): void;
38
39- Before change:
40
41```js
42setWebController(controller: WebController): void;
43```
44
45- After change:
46
47```js
48setWebController(controller: WebviewController): void;
49```
50
51**Adaptation Guide**
52
53The sample code is as follows:
54
55Before change:
56
57```js
58// xxx.ets
59@Entry
60@Component
61struct WebComponent {
62  controller:WebController = new WebController()
63  build() {
64    Column() {
65      Web({ src:'www.example.com', controller: this.controller })
66      .multiWindowAccess(true)
67      .onWindowNew((event) => {
68        console.log("onWindowNew...")
69        var popController: WebController = new WebController()
70        event.handler.setWebController(popController)
71      })
72    }
73  }
74}
75```
76
77After change:
78```js
79// xxx.ets
80@Entry
81@Component
82struct WebComponent {
83  controller: web_webview.WebviewController = new web_webview.WebviewController()
84  build() {
85    Column() {
86      Web({ src:'www.example.com', controller: this.controller })
87      .multiWindowAccess(true)
88      .onWindowNew((event) => {
89        console.log("onWindowNew...")
90        var popController: web_webview.WebviewController = new web_webview.WebviewController()
91        event.handler.setWebController(popController)
92      })
93    }
94  }
95}
96```
97
98## cl.web.3 getUnfilterendLinkUrl API Name Change
99
100The **getUnfilterendLinkUrl** API is misspelled and should be changed to **getUnfilteredLinkUrl**.
101
102**Change Impacts**
103
104The JS API name needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
105
106**Key API/Component Changes**
107
108- Involved API:
109
110  getUnfilteredLinkUrl(): string;
111
112- Before change:
113
114```js
115getUnfilterendLinkUrl(): string;
116```
117
118- After change:
119
120```js
121getUnfilteredLinkUrl(): string;
122```
123
124**Adaptation Guide**
125
126The JS API name needs to be adapted for applications developed based on earlier versions. The new API name is used to replace the original one. Otherwise, relevant functions will be affected.
127