Skip to content

Commit 9a691a6

Browse files
committed
Fix beforeLoad
1 parent ef6c5f0 commit 9a691a6

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/android/InAppBrowser.java

Lines changed: 1 addition & 13 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
});
@@ -1105,7 +1099,6 @@ public class InAppBrowserClient extends WebViewClient {
11051099
EditText edittext;
11061100
CordovaWebView webView;
11071101
String beforeload;
1108-
boolean waitForBeforeload;
11091102

11101103
/**
11111104
* Constructor.
@@ -1117,7 +1110,6 @@ public InAppBrowserClient(CordovaWebView webView, EditText mEditText, String bef
11171110
this.webView = webView;
11181111
this.edittext = mEditText;
11191112
this.beforeload = beforeload;
1120-
this.waitForBeforeload = beforeload != null;
11211113
}
11221114

11231115
/**
@@ -1178,7 +1170,7 @@ public boolean shouldOverrideUrlLoading(String url, String method) {
11781170
}
11791171

11801172
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
1181-
if (useBeforeload && this.waitForBeforeload) {
1173+
if (useBeforeload) {
11821174
if(sendBeforeLoad(url, method)) {
11831175
return true;
11841176
}
@@ -1272,10 +1264,6 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
12721264
}
12731265
}
12741266
}
1275-
1276-
if (useBeforeload) {
1277-
this.waitForBeforeload = true;
1278-
}
12791267
return override;
12801268
}
12811269

0 commit comments

Comments
 (0)