Questions tagged [webview]

Elements in graphical user interfaces that host HTML content. For Android, look at the android-webview tag. For iOS, look under uiwebview or wkwebview. For VS Code, look under vscode-webview.

A user interface element that displays web pages. Generally, it is the basis upon which you can roll your own web browser or simply display some online content within your application.

: WebView class reference for Android

: WKWebView class reference for iOS

: UIWebView class reference for iOS (deprecated)

: Webview API for Visual Studio Code

: WebView that is used in Ionic

WebView class reference for macOS (deprecated)

webview tag reference for Chrome apps

WebView: a Node that displays WebEngine content.

22469 questions
45
votes
5 answers

Android Webview POST

I am trying to accomplish something quite simple, yet I have found no good documentation on this. I have a webView, and I need to load a page in it that requires POST data. Seems like a simple process, yet I cannot find a way to display the result…
Señor Reginold Francis
  • 16,318
  • 16
  • 57
  • 73
45
votes
2 answers

Eclipse continue crashing

today my Eclipse continue crashing and show me this message: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f9d6dfd4c91, pid=5739, tid=140316573566720 # # JRE version: 7.0_25-b30 # Java VM:…
Luca Panteghini
  • 2,657
  • 3
  • 21
  • 27
45
votes
9 answers

HTML file input in android webview (android 4.4, kitkat)

I was using the on the android webview. I got it working thanks to this thread: File Upload in WebView But the accepted answer (or any other) no longer works with android 4.4 kitkat webview. Anybody knows how to fix it? It…
jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
44
votes
13 answers

Android detect webview URL change

I have a webview in my android app and would like to detect when the url changes. I want to use this to hide the info button in the top bar when the user is on the info.php page and show it again when he is not on the info.php page. I googled but…
Daniel
  • 1,275
  • 1
  • 22
  • 31
44
votes
1 answer

How to get the body of the WebResourceRequest in android webView

I need to modify the request header of the android webView request. So, I add the following code in the method shouldInterceptRequest. Here is my code: @Override public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest…
郑凯拓
  • 441
  • 4
  • 3
44
votes
5 answers

Load local html in WebView?

I want to load a local html into a WebView WITHOUT using "file:///" because that does not allow cookies. Is there a way to use something like "localhost" ? Secondly, I could not find a way to enable cookies in the getSettings(). Because cookies are…
Jash Sayani
  • 1,241
  • 3
  • 12
  • 17
44
votes
7 answers

(React Native) Load local HTML file into WebView

I try to load the local .html file into WebView in React Native: // load local .html file const PolicyHTML = require('./Policy.html'); // PolicyHTML is just a number of `1` console.log('PolicyHTML:', PolicyHTML); // will cause an error: JSON value…
Xaree Lee
  • 3,188
  • 3
  • 34
  • 55
44
votes
2 answers

Enhance webView performance (should be the same performance as native Web Browser)

My experience is that loading websites in a WebView is much slower than performing the same actions in the Android Web Browser. I can see that all files have been loaded in my Apache log, it will take a few seconds until the page is displayed in the…
Hansjoerg
  • 441
  • 1
  • 5
  • 3
44
votes
6 answers

Retrieve User-Agent programmatically

Is there a way to retrieve Browser's user-agent without having a WebView in activity? I know it is possible to get it via WebView: WebView view = (WebView) findViewById(R.id.someview); String ua = view.getSettings().getUserAgentString() ; But in my…
Laimoncijus
  • 8,615
  • 10
  • 58
  • 81
44
votes
3 answers

Android WebView UTF-8 not showing

I have a webview and am trying to load simple UTF-8 text into it. mWebView.loadData("將賦予他們的傳教工作標示為", "text/html", "UTF-8"); But the WebView displays ANSI/ASCII garbage. Obviously an encoding issue, but what am I missing in telling the webview to…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
43
votes
6 answers

Detect click on HTML button through javascript in Android WebView

I'm not highly familiar with javascript but I think this is the best way to accomplish my purpose. If not, please correct me. I have a licence text 2 buttons at the end. All of this is written in HTML in a WebView because there are some links in…
Sephy
  • 50,022
  • 30
  • 123
  • 131
43
votes
5 answers

Call Android methods from JavaScript

I searched, but I didn't find an answer. I'm developing an Android app based on webview, using HTML5 and JavaScript. Can I call an Android method, like makeToast() from JavaScript?
bodruk
  • 3,242
  • 8
  • 34
  • 52
43
votes
4 answers

Android Web-View : Inject local Javascript file to Remote Webpage

It has been asked many times before, I browsed through everything, no clear answers yet. Question simplified: Is it possible to inject local Javascript file (from asset or storage) to remote webpage loaded in an Android Web-View? I know that it is…
sumit
  • 723
  • 1
  • 7
  • 16
42
votes
11 answers

Fixed header disappear when scrolling down in webview in iOS 11

I have a native iOS app with a webview to display web content. I have a fixed header in my app with the following properties: #header { height: 60px; background-color: @mainColor; color: #ffffff; padding: 10px; text-align:…
Bergerova
  • 863
  • 3
  • 10
  • 21
42
votes
11 answers

Is there a listener for when the WebView displays it's content?

Using WebViewClient and/or the WebChromeClient you can get a listener for when the page has loaded, however this is sometimes called before the WebView has any content in it, before it has displayed anything. What would be a efficient method for…
cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171