Skip to content

Commit 6219151

Browse files
committed
fix: android crash
1 parent a4897fd commit 6219151

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/webview.android.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ function initializeWebViewClient(): void {
7979
@NativeClass
8080
class WebViewImpl extends android.webkit.WebView {
8181
isScrollEnabled = true;
82+
83+
constructor(context: android.content.Context) {
84+
super(context);
85+
return global.__native(this);
86+
}
8287
overScrollBy(
8388
param0: number,
8489
param1: number,
@@ -111,12 +116,6 @@ function initializeWebViewClient(): void {
111116
@NativeClass
112117
class AWebViewClientImpl extends android.webkit.WebViewClient {
113118
owner: WeakRef<AWebView>;
114-
// constructor(owner: AWebView) {
115-
// super();
116-
117-
// this.owner = new WeakRef(owner);
118-
// return global.__native(this);
119-
// }
120119

121120
/**
122121
* Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
@@ -302,12 +301,7 @@ function initializeWebViewClient(): void {
302301
@NativeClass
303302
class WebChromeViewExtClientImpl extends android.webkit.WebChromeClient {
304303
private owner: WeakRef<AWebView>;
305-
// constructor(owner: AWebView) {
306-
// super();
307304

308-
// this.owner = new WeakRef(owner);
309-
// return global.__native(this);
310-
// },
311305
onGeolocationPermissionsHidePrompt(): void {
312306
return super.onGeolocationPermissionsHidePrompt();
313307
}
@@ -459,10 +453,12 @@ export class AWebView extends AWebViewBase {
459453

460454
protected readonly localResourceMap = new Map<string, string>();
461455

456+
//@ts-ignore
462457
public get isUIWebView() {
463458
return false;
464459
}
465460

461+
//@ts-ignore
466462
public get isWKWebView() {
467463
return false;
468464
}

0 commit comments

Comments
 (0)