ProWebview doesn't open inner URL with the html Tag traget_blank
hey thank you for this nice library, i have just one Problem with the ProWebview.
when i load for example this url https://coinmarketcap.com/currencies/bitcoin/ in the ProWebview and try to click on an inner url that normally will be opened in a new browser tab, the ProWebview did nothing, as if it ignore the click completely. how can it tell the webview, that it should open this Link as in the same view ?
can you please help with that. i'm using a fragment within an activity to show the webview: here is my webview xml.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<vcm.github.webkit.proview.ProWebView
android:id="@+id/webview_search"
app:cacheMode="cacheElseNetwork"
app:javascriptEnabled="true"
app:nestedScrollingEnabled="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
an the webview implementation
myWebView = root.findViewById(R.id.webview_search);
myWebView.setFragment(this);
myWebView.loadUrl("https://coinmarketcap.com/currencies/bitcoin/");
myWebView.setProClient(new ProWebView.ProClient() {
@Override
public boolean shouldOverrideUrlLoading(ProWebView webView, String url) {
return false;
}
@Override
public void onReceivedError(ProWebView webView, ProWebResourceRequest resourceRequest, ProWebResourceError webResourceError) {
super.onReceivedError(webView, resourceRequest, webResourceError);
}
});
I've same issue here. I tried with and without target="_blank", no success.
In my implementation of ProWebView.ProClient, I overrided method shouldOverrideUrlLoading to return true and before return I call webView.loadUrl(url). It worked.
Can you confirm this approach to close this issue @korchix?
I based my approach in this stackoverflow answer
@pedrofsn thank you for your effort. i have switched to Flutter, so i'm not using this anymore. hence i can't test it. but your answer seems legit and should work. you can close this ticket. thank you.