From 566c00245f2ba36dd9c64882612a0756d276c9c6 Mon Sep 17 00:00:00 2001 From: Swati Jha Date: Fri, 31 Jul 2020 14:05:19 -0400 Subject: [PATCH] (android) Removing waitForBeforeload flag as it prevents beforeLoad to be called for every GET request and it does not seem to have any meaningful use --- src/android/InAppBrowser.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index b3e0e6126..c3f7cb6ee 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -269,12 +269,6 @@ else if (action.equals("loadAfterBeforeload")) { @SuppressLint("NewApi") @Override public void run() { - if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) { - currentClient.waitForBeforeload = false; - inAppWebView.setWebViewClient(currentClient); - } else { - ((InAppBrowserClient)inAppWebView.getWebViewClient()).waitForBeforeload = false; - } inAppWebView.loadUrl(url); } }); @@ -1163,7 +1157,6 @@ public class InAppBrowserClient extends WebViewClient { EditText edittext; CordovaWebView webView; String beforeload; - boolean waitForBeforeload; /** * Constructor. @@ -1175,7 +1168,6 @@ public InAppBrowserClient(CordovaWebView webView, EditText mEditText, String bef this.webView = webView; this.edittext = mEditText; this.beforeload = beforeload; - this.waitForBeforeload = beforeload != null; } /** @@ -1236,7 +1228,7 @@ public boolean shouldOverrideUrlLoading(String url, String method) { } // On first URL change, initiate JS callback. Only after the beforeload event, continue. - if (useBeforeload && this.waitForBeforeload) { + if (useBeforeload) { if(sendBeforeLoad(url, method)) { return true; } @@ -1331,9 +1323,6 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^ } } - if (useBeforeload) { - this.waitForBeforeload = true; - } return override; }