@@ -273,12 +273,6 @@ else if (action.equals("loadAfterBeforeload")) {
273
273
@ SuppressLint ("NewApi" )
274
274
@ Override
275
275
public void run () {
276
- if (android .os .Build .VERSION .SDK_INT < android .os .Build .VERSION_CODES .O ) {
277
- currentClient .waitForBeforeload = false ;
278
- inAppWebView .setWebViewClient (currentClient );
279
- } else {
280
- ((InAppBrowserClient )inAppWebView .getWebViewClient ()).waitForBeforeload = false ;
281
- }
282
276
inAppWebView .loadUrl (url );
283
277
}
284
278
});
@@ -722,6 +716,8 @@ public String showWebPage(final String url, HashMap<String, String> features) {
722
716
}
723
717
if (features .get (BEFORELOAD ) != null ) {
724
718
beforeload = features .get (BEFORELOAD );
719
+ } else {
720
+ beforeload = "" ;
725
721
}
726
722
String fullscreenSet = features .get (FULLSCREEN );
727
723
if (fullscreenSet != null ) {
@@ -1173,7 +1169,6 @@ public class InAppBrowserClient extends WebViewClient {
1173
1169
EditText edittext ;
1174
1170
CordovaWebView webView ;
1175
1171
String beforeload ;
1176
- boolean waitForBeforeload ;
1177
1172
1178
1173
/**
1179
1174
* Constructor.
@@ -1185,7 +1180,6 @@ public InAppBrowserClient(CordovaWebView webView, EditText mEditText, String bef
1185
1180
this .webView = webView ;
1186
1181
this .edittext = mEditText ;
1187
1182
this .beforeload = beforeload ;
1188
- this .waitForBeforeload = beforeload != null ;
1189
1183
}
1190
1184
1191
1185
/**
@@ -1246,7 +1240,7 @@ public boolean shouldOverrideUrlLoading(String url, String method) {
1246
1240
}
1247
1241
1248
1242
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
1249
- if (useBeforeload && this . waitForBeforeload ) {
1243
+ if (useBeforeload ) {
1250
1244
if (sendBeforeLoad (url , method )) {
1251
1245
return true ;
1252
1246
}
@@ -1341,9 +1335,6 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
1341
1335
}
1342
1336
}
1343
1337
1344
- if (useBeforeload ) {
1345
- this .waitForBeforeload = true ;
1346
- }
1347
1338
return override ;
1348
1339
}
1349
1340
0 commit comments