@@ -24,10 +24,6 @@ class NativeProxy {
2424 this.webviewController = webviewController
2525 }
2626
27- propUpdate(key: object, value: object): void {
28- hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'propUpdate: ' + key + ", value: " + value);
29- }
30-
3127 sendInput(data: string): void {
3228 hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'sendInput: ' + data);
3329 let buffer = stringToArrayBuffer(data, 'utf-8');
@@ -40,32 +36,11 @@ class NativeProxy {
4036 napi.resize(s.width, s.height)
4137 }
4238
43- focus(): void {
44- hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'focus')
45- }
46-
47- syncFocus(): void {
48- hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'syncFocus')
49- }
50-
51- newScrollHeight(h: number): void {
52- hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'newScrollHeight: ' + h)
53- }
54-
55- newScrollTop(h: number): void {
56- hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'newScrollTop: ' + h)
57- }
58-
59- openLink(url: string): void {
60- hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'openLink: ' + url)
61- }
62-
6339 async load(): Promise<void> {
40+
6441 hilog.info(DOMAIN, 'WebTerminal', '%{public}s', 'load')
6542 this.webviewController.runJavaScript('exports.setFocused(true)')
6643
67- const s: Size = await this.getSize();
68-
6944 napi.onData((a: ArrayBuffer) => {
7045 let dec = util.TextDecoder.create('utf-8', { ignoreBOM: true })
7146 let s: string = dec.decodeToString(new Uint8Array(a))
@@ -75,14 +50,14 @@ class NativeProxy {
7550 this.webviewController.runJavaScript('exports.write("' + s + '")')
7651 })
7752
53+ const s: Size = await this.getSize();
7854 napi.run(s.width, s.height)
7955 }
8056
8157 private async getSize(): Promise<Size> {
8258 const ext = await this.webviewController.runJavaScriptExt('exports.getSize()');
8359 const arr = ext.getArray();
84- const w = arr[0] as number, h = arr[1] as number;
85- return { width: w, height: h };
60+ return { width: arr[0] as number, height: arr[1] as number };
8661 }
8762}
8863
@@ -111,8 +86,7 @@ struct Index {
11186 .javaScriptProxy({
11287 object: this.native,
11388 name: 'native',
114- methodList: ['propUpdate', 'sendInput', 'resize', 'focus', 'syncFocus',
115- 'newScrollHeight', 'newScrollTop', 'openLink', 'load', 'syncFocus'],
89+ methodList: ['sendInput', 'resize', 'load'],
11690 controller: this.webviewController,
11791 asyncMethodList: [],
11892 permission: `{
0 commit comments