(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
This commit is contained in:
parent
91ebdf2776
commit
566c00245f
@ -269,12 +269,6 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
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);
|
inAppWebView.loadUrl(url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1163,7 +1157,6 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
EditText edittext;
|
EditText edittext;
|
||||||
CordovaWebView webView;
|
CordovaWebView webView;
|
||||||
String beforeload;
|
String beforeload;
|
||||||
boolean waitForBeforeload;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -1175,7 +1168,6 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
this.webView = webView;
|
this.webView = webView;
|
||||||
this.edittext = mEditText;
|
this.edittext = mEditText;
|
||||||
this.beforeload = beforeload;
|
this.beforeload = beforeload;
|
||||||
this.waitForBeforeload = beforeload != null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1236,7 +1228,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
|
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
|
||||||
if (useBeforeload && this.waitForBeforeload) {
|
if (useBeforeload) {
|
||||||
if(sendBeforeLoad(url, method)) {
|
if(sendBeforeLoad(url, method)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1331,9 +1323,6 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useBeforeload) {
|
|
||||||
this.waitForBeforeload = true;
|
|
||||||
}
|
|
||||||
return override;
|
return override;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user