I have written custom webviewclient class to override onPageStarted, onPageFinished etc
in cordova 3.7 which was working fine.
In following code is I ha
It was replaced by SystemWebViewClient
You should do something like this:
SystemWebView wv = (SystemWebView)appView.getView();
wv.setWebViewClient(new SystemWebViewClient((SystemWebViewEngine)appView.getEngine()){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
Log.i("CSP Log", "onPageStarted: " + url);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
Log.i("CSP Log", "onPageFinished: " + url);
}
@Override
public void doUpdateVisitedHistory(WebView view, String url, boolean isReload){
super.doUpdateVisitedHistory(view, url, isReload);
}
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
}
});
Apache cordova removed CordovaWebViewClient inorder to support external webviews like Crosswalk. If you check out the 14 changed files
link in the following commit link, you could see CordovaWebViewClient is removed and AndroidWebViewClient is added.
So i guess you cannot use the same old code work in Cordova 6.0
You can probably try using org.apache.cordova.engine.SystemWebViewClient
instead.
Infact, the same question is answered here and it was also accepted. So i believe this is the possible solution to the issue. Hope it helps.
Cordova 4 removed the CordovaWebViewClient
: look here
You may use WebViewClient
instead of CordovaWebViewClient
(The cordova-plugin-inappbrowser plugin use that for override onPageStarted
event).
public class CustomCordovaWebViewClient extends WebViewClient