webviewclient

How to get link-URL in Android WebView with HitTestResult for a linked image (and not the image-URL) with Longclick

扶醉桌前 提交于 2019-11-27 02:26:19
问题 I try to catch webview longclicks to show a context menu. (see code below) When longclicking an image, I always get the image-URL as extra (for a not linked image with IMAGE_TYPE and for a linked image with SRC_IMAGE_ANCHOR_TYPE). But how can I get the Link-URL (and not the image-URL) for an image with a hyperlink? Best, Sebastian mywebview.setOnLongClickListener(new OnLongClickListener() { public boolean onLongClick(View v) { final WebView webview = (WebView) v; final WebView.HitTestResult

Check in the onReceivedSslError() method of a WebViewClient if a certificate is signed from a specific self-signed CA

别来无恙 提交于 2019-11-27 01:22:05
问题 I would like to override the onReceivedSslError() of a WebViewClient . Here I want to check if the error.getCertificate() certificate is signed from a self-signed CA and, only in this case , call the handler.proceed() . In pseudo-code: @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { SslCertificate serverCertificate = error.getCertificate(); if (/* signed from my self-signed CA */) { handler.proceed(); } else { super.onReceivedSslError(view,

Enabling general JavaScript in WebViewClient

て烟熏妆下的殇ゞ 提交于 2019-11-27 00:54:41
While searching for an answer in google, it seems that I'm not the only one stuck with a problem that seems impossible to solve. I've managed to create a WebView with a custom WebViewClient - this makes it possible for me to have a processdialog and show an error message if an URL couldn't be loaded. But this creates a problem with JavaScript. The URL I'm loading has some JavaScript which changes some HTML elements CSS styles (showing or hiding element) or redirects to another location onclick - or maybe even want's to show an alert box. But by using the WebViewClient none of those are working

What's the difference between setWebViewClient vs. setWebChromeClient?

半腔热情 提交于 2019-11-26 23:26:24
What's the difference between setWebViewClient vs. setWebChromeClient in Android? Cristian From the source code : // Instance of WebViewClient that is the client callback. private volatile WebViewClient mWebViewClient; // Instance of WebChromeClient for handling all chrome functions. private volatile WebChromeClient mWebChromeClient; // SOME OTHER SUTFFF....... /** * Set the WebViewClient. * @param client An implementation of WebViewClient. */ public void setWebViewClient(WebViewClient client) { mWebViewClient = client; } /** * Set the WebChromeClient. * @param client An implementation of

Android : EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up

泪湿孤枕 提交于 2019-11-26 20:57:51
问题 I have implemented WebView in Dialog Activity and I am loading simple url into webview. my Webview settings are as wbView = (WebView) findViewById(R.id.wbView); wbView.setKeepScreenOn(true); wbView.getSettings().setJavaScriptEnabled(true); wbView.getSettings().setDomStorageEnabled(true); wbView.getSettings().setBuiltInZoomControls(true); wbView.setInitialScale(100); // wbView.getSettings().setUseWideViewPort(true); wbView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); wbView

shouldOverrideUrlLoading in WebView for Android not running

人走茶凉 提交于 2019-11-26 17:36:30
问题 -Edit: Solution Found- Figured it out after some heavy searching - one person (I literally mean one) said they instead used onPageLoad(); which worked perfectly for my purposes. The difference is that onPageLoad() runs later than shouldOverrideUrlLoading, but It doesn't make a difference in my code. I'm trying to set up Twitter authorization with OAuth for an Android app, and thus far I can successfully send the user to the authorization URL, however, what I am trying to do now is intercept

Enabling specific SSL protocols with Android WebViewClient

无人久伴 提交于 2019-11-26 10:46:56
问题 My application uses WebViewClient to make SSL connections to the server. The server is configured to only accept TLSv1.1 and above protocols. 1) How do I check which SSL protocols are a) Supported and b) Enabled by default when using Android WebViewClient on a device. 2) How do I enable specific SSL protocols for Android WebViewClient instance used in my application. On one of the test devices running Android 4.3, WebViewClient throws onReceivedError callback with description \"Failed to

Android WebView for Facebook Like Button

断了今生、忘了曾经 提交于 2019-11-26 10:28:41
问题 I\'m trying to make facebook like functionality in Android WebView (project specification does not allow browser opening, or any out of application activity). So, restrictions are that it has to be done in WebView. I\'ve managed to make it a dialog, and apon user\'s click like button, it (the WebView) redirects successfully (in the same view) to facebooks login page. After successful authentication, the WebView (in a dialog) is redirected to blank page with facebook header. Interestingly

Enabling general JavaScript in WebViewClient

不想你离开。 提交于 2019-11-26 09:29:37
问题 While searching for an answer in google, it seems that I\'m not the only one stuck with a problem that seems impossible to solve. I\'ve managed to create a WebView with a custom WebViewClient - this makes it possible for me to have a processdialog and show an error message if an URL couldn\'t be loaded. But this creates a problem with JavaScript. The URL I\'m loading has some JavaScript which changes some HTML elements CSS styles (showing or hiding element) or redirects to another location

What's the difference between setWebViewClient vs. setWebChromeClient?

只愿长相守 提交于 2019-11-26 07:52:11
问题 What\'s the difference between setWebViewClient vs. setWebChromeClient in Android? 回答1: From the source code: // Instance of WebViewClient that is the client callback. private volatile WebViewClient mWebViewClient; // Instance of WebChromeClient for handling all chrome functions. private volatile WebChromeClient mWebChromeClient; // SOME OTHER SUTFFF....... /** * Set the WebViewClient. * @param client An implementation of WebViewClient. */ public void setWebViewClient(WebViewClient client) {