Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit b80388b

Browse files
author
Mark van Rij
committed
fix: beforeLoad in Android: apache#755
1 parent f155a4f commit b80388b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/android/InAppBrowser.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,6 @@ else if (action.equals("loadAfterBeforeload")) {
263263
@SuppressLint("NewApi")
264264
@Override
265265
public void run() {
266-
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) {
267-
currentClient.waitForBeforeload = false;
268-
inAppWebView.setWebViewClient(currentClient);
269-
} else {
270-
((InAppBrowserClient)inAppWebView.getWebViewClient()).waitForBeforeload = false;
271-
}
272266
inAppWebView.loadUrl(url);
273267
}
274268
});
@@ -1098,7 +1092,6 @@ public class InAppBrowserClient extends WebViewClient {
10981092
EditText edittext;
10991093
CordovaWebView webView;
11001094
String beforeload;
1101-
boolean waitForBeforeload;
11021095

11031096
/**
11041097
* Constructor.
@@ -1110,7 +1103,6 @@ public InAppBrowserClient(CordovaWebView webView, EditText mEditText, String bef
11101103
this.webView = webView;
11111104
this.edittext = mEditText;
11121105
this.beforeload = beforeload;
1113-
this.waitForBeforeload = beforeload != null;
11141106
}
11151107

11161108
/**
@@ -1171,7 +1163,7 @@ public boolean shouldOverrideUrlLoading(String url, String method) {
11711163
}
11721164

11731165
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
1174-
if (useBeforeload && this.waitForBeforeload) {
1166+
if (useBeforeload) {
11751167
if(sendBeforeLoad(url, method)) {
11761168
return true;
11771169
}
@@ -1266,9 +1258,6 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
12661258
}
12671259
}
12681260

1269-
if (useBeforeload) {
1270-
this.waitForBeforeload = true;
1271-
}
12721261
return override;
12731262
}
12741263

0 commit comments

Comments
 (0)