Skip to content

Commit e2621ba

Browse files
Alessandro BassoAlessandro Basso
Alessandro Basso
authored and
Alessandro Basso
committed
Cherry picked changes from bug-686 branch to fix inappbrowser issue apache#686 (PR apache#755)
1 parent 1d3542a commit e2621ba

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
@@ -271,12 +271,6 @@ else if (action.equals("loadAfterBeforeload")) {
271271
@SuppressLint("NewApi")
272272
@Override
273273
public void run() {
274-
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) {
275-
currentClient.waitForBeforeload = false;
276-
inAppWebView.setWebViewClient(currentClient);
277-
} else {
278-
((InAppBrowserClient)inAppWebView.getWebViewClient()).waitForBeforeload = false;
279-
}
280274
inAppWebView.loadUrl(url);
281275
}
282276
});
@@ -1197,7 +1191,6 @@ public class InAppBrowserClient extends WebViewClient {
11971191
EditText edittext;
11981192
CordovaWebView webView;
11991193
String beforeload;
1200-
boolean waitForBeforeload;
12011194

12021195
/**
12031196
* Constructor.
@@ -1209,7 +1202,6 @@ public InAppBrowserClient(CordovaWebView webView, EditText mEditText, String bef
12091202
this.webView = webView;
12101203
this.edittext = mEditText;
12111204
this.beforeload = beforeload;
1212-
this.waitForBeforeload = beforeload != null;
12131205
}
12141206

12151207
/**
@@ -1270,7 +1262,7 @@ public boolean shouldOverrideUrlLoading(String url, String method) {
12701262
}
12711263

12721264
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
1273-
if (useBeforeload && this.waitForBeforeload) {
1265+
if (useBeforeload) {
12741266
if(sendBeforeLoad(url, method)) {
12751267
return true;
12761268
}
@@ -1365,9 +1357,6 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
13651357
}
13661358
}
13671359

1368-
if (useBeforeload) {
1369-
this.waitForBeforeload = true;
1370-
}
13711360
return override;
13721361
}
13731362

0 commit comments

Comments
 (0)