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
292
votes
8 answers

Android webview & localStorage

I have a problem with a webview which may access to the localStorage by an HTML5 app. The test.html file informs me that local storage is'nt supported by my browser (ie. the webview). If you have any suggestion.. package com.test.HelloWebView;…
Thomas
  • 9,299
  • 3
  • 16
  • 7
284
votes
8 answers

Android Calling JavaScript functions in WebView

I am trying to call some javascript functions sitting in an html page running inside an android webview. Pretty simple what the code tries to do below - from the android app, call a javascript function with a test message, which inturn calls a java…
user163757
  • 6,795
  • 9
  • 32
  • 47
242
votes
7 answers

Android Webview gives net::ERR_CACHE_MISS message

2023 Edit: This question was from 2015. You may be able to find more suitable answers elsewhere. I built a web app and wants to create an android app that has a webview that shows my web app. After following the instructions from Google Developer to…
zehata
  • 3,354
  • 2
  • 14
  • 23
219
votes
7 answers

How to check if a file exists in Documents folder?

I have an application with In-App Purchase, that when the user buy something, download one html file into the Documents folder of my app. Now I must check if this HTML file exists, so if true, load this HTML file, else load my default html page. How…
Obliviux
  • 2,659
  • 4
  • 21
  • 11
208
votes
22 answers

File Upload in WebView

I have been struggling to upload files from WebView. I googled and implemented all suggested solutions (e.g. this SO post), but none work. I have an HTML page with the following code to upload a file.
user741148
  • 2,099
  • 3
  • 13
  • 6
189
votes
7 answers

jQuery get the location of an element relative to window

Given an HTML DOM ID, how to get an element's position relative to the window in JavaScript/JQuery? This is not the same as relative to the document nor offset parent since the element may be inside an iframe or some other elements. I need to get…
adib
  • 8,285
  • 6
  • 52
  • 91
187
votes
10 answers

Android webview slow

My android webviews are slow. This is on everything from phones to 3.0+ tablets with more than adequate specs I know that webviews are supposed to be "limited" but I see web apps done with phone gap that must be using all sorts of CSS3 and JQuery…
CQM
  • 42,592
  • 75
  • 224
  • 366
181
votes
11 answers

Swift Open Link in Safari

I am currently opening the link in my app in a WebView, but I'm looking for an option to open the link in Safari instead.
Fabian Boulegue
  • 6,476
  • 14
  • 47
  • 72
174
votes
23 answers

Android WebView style background-color:transparent ignored on android 2.2

I'm struggling to create a WebView with transparent background. webView.setBackgroundColor(0x00FFFFFF); webView.setBackgroundDrawable(myDrawable); Then I load a html page with
jptsetung
  • 9,064
  • 3
  • 43
  • 55
170
votes
5 answers

How to pass html string to webview on android?

I am parsing xml and then loading it to web view. After parsing, I am creating four strings so that I could append all strings to one view. I am able to get two views on the web view, but not the first two strings. Please suggest in my code, where I…
cavallo
  • 4,414
  • 9
  • 39
  • 61
170
votes
5 answers

Is `shouldOverrideUrlLoading` really deprecated? What can I use instead?

Is "shouldOverrideUrlLoading" really deprecated? If so, what can I use instead? It seems like shouldOverrideUrlLoading is deprecated targeting Android N and I need to make an app work since API 19 until the latest right now which is Android N…
Minion
  • 2,497
  • 4
  • 27
  • 29
152
votes
20 answers

Android WebView: handling orientation changes

The issue is the performance following rotation. The WebView has to reload the page, which can be a bit tedious. What's the best way of handling an orientation change without reloading the page from source each time?
glennanthonyb
  • 1,855
  • 2
  • 14
  • 10
151
votes
21 answers

android.view.InflateException Error inflating class android.webkit.WebView

In Lollipop (API 22) every time in my application I show a webview the application crashes. I have multiple crashes in my android developer console related to this event. No need to say that it works on Android 4, 6 and 7. Reading the stack trace…
Valerio
  • 3,297
  • 3
  • 27
  • 44
148
votes
6 answers

How to enable zoom controls and pinch zoom in a WebView?

The default Browser app for Android shows zoom controls when you're scrolling and also allows for pinch zooming. How can I enable this feature for my own Webview? I've tried:…
Robert Bana
  • 2,135
  • 3
  • 17
  • 23
142
votes
13 answers

how to get html content from a webview?

Which is the simplest method to get html code from a webview? I have tried several methods from stackoverflow and google, but can't find an exact method. Please mention an exact way. public class htmldecoder extends Activity implements…
user765970
1
2 3
99 100