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.

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 that is used in Ionic

WebView class reference for macOS (deprecated)

webview tag reference for Chrome apps

WebView: a Node that displays WebEngine content.

21017 questions
85
votes
1 answer

Android Webview: "Uncaught TypeError: Cannot read property 'getItem' of null"

I am creating a simple android app which has a webview which should display a url. When I give the url as google.com or facebook.com it loads properly but when I give my url(qbo.intuit.com), it doesn't load and gives the "Uncaught TypeError: Cannot…
Sonal
  • 1,008
  • 1
  • 8
  • 9
85
votes
6 answers

Download file inside WebView

I have a webview in my Android Application. When user goes to webview and click a link to download a file nothing happens. URL = "my url"; mWebView = (WebView) findViewById(R.id.webview); mWebView.setWebViewClient(new…
Jay Mayu
  • 15,955
  • 31
  • 111
  • 144
83
votes
7 answers

Rendering HTML in a WebView with custom CSS

My app is using JSoup to download the HTML of a message board page (let's say in this case it is a page containing the posts of a given thread). I'd like to take this HTML, strip out unwanted items, and apply custom CSS to style it to be 'mobile' in…
thedude19
  • 2,603
  • 4
  • 31
  • 42
76
votes
9 answers

Android WebView with garbled UTF-8 characters.

I'm using some webviews in my android app, but are unable to make them display in utf-8 encoding. If use this one I won't see my scandinavian charcters: mWebView.loadUrl("file:///android_asset/om.html") And if try this one, I won't get anything…
elwis
  • 1,355
  • 2
  • 17
  • 33
76
votes
9 answers

How to set the initial zoom/width for a webview

I am trying to get the WebView to have similar behavior as the android browser. The browser opens all pages in a way that tries to fit their width to the screen. However, the default behavior of the WebView is to start at a 100% pixel scale so it…
cottonBallPaws
  • 20,217
  • 37
  • 119
  • 169
75
votes
2 answers

What do setUseWideViewPort() and setLoadWithOverviewMode() precisely do?

I am disappointed at the lack of documentation of WebView and related stuff. (unless you think the following is propert documetation) public void setLoadWithOverviewMode (boolean overview) Set whether the WebView loads a page with overview …
tacone
  • 10,962
  • 8
  • 39
  • 59
74
votes
8 answers

Enabling general JavaScript in WebViewClient

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…
Repox
  • 14,127
  • 6
  • 52
  • 74
74
votes
2 answers

WebView load website when online, load local file when offline

I am actually new to programming in Java but I have been following several solutions to my problem here but didn't find one that suits my case and I can't seem to get the code down correctly. I would like to have a WebView that opens an online page…
mstation
  • 1,062
  • 1
  • 9
  • 15
73
votes
9 answers

Android activity as dialog, but without a title bar

I have an activity that has the following set as theme: android:theme="@android:style/Theme.Dialog" However, there is a title bar in the activity-dialog that appears, that uses up the little available space that I have. How can I remove it?
Shade
  • 9,366
  • 5
  • 54
  • 81
71
votes
2 answers

Are WebViewClient and WebChromeClient mutually exclusive?

From this great explanation about the differences between WebViewClient and WebChromeClient it seems that if you use one, you shouldn't be using the other (for the same WebView object). Is my understanding correct? If not, when would one use both…
ef2011
  • 9,581
  • 12
  • 45
  • 67
70
votes
7 answers

Android WebView progress bar

I have looked at a question similar to this here but as I am a newbie could someone explain how to get this to work in a WebView or at least how to set a 10 second time delay so people know that it's loading?
Max Marroni
  • 927
  • 1
  • 7
  • 7
67
votes
18 answers

How to stop youtube video playing in Android webview?

How can I stop a YouTube video which is played in my webview? When I click on the back button the video doesn't stop and instead continues in the background. Code: webView = (WebView) findViewById(R.id.webview);…
Droid
  • 1,081
  • 2
  • 9
  • 14
67
votes
1 answer

Separate cookie jar per WebView in OS X

I've been trying to achieve the goal of having a unique (not shared) cookie jar per WebView in macOS (cookies management works different for iOS). After reading a lot of StackOverflow questions and digging through the docs, I found the closest…
Juanjo Conti
  • 25,163
  • 37
  • 101
  • 128
63
votes
4 answers

How to load html string in a webview?

i have a html string containing this:
NullPointerException
  • 32,153
  • 66
  • 194
  • 346
62
votes
6 answers

Make Android WebView not store cookies or passwords

I use an Android WebView for Twitter OAuth: Twitter asks the user to log in and authorize the application, I retrieve the access token and persist it in my application. I have no need (and do not) store the user password, but the WebView keeps…
Thilo
  • 241,635
  • 91
  • 474
  • 626