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
42
votes
5 answers

Error inflating class android.webkit.WebView happens sporadically in production

my application is on Google Play and it runs fine on most of devices (thousands of users). But in rare cases (fraction of percent of daily active users) I get Error inflating class android.webkit.WebView when I inflate layout for my fragment in…
d.aemon
  • 761
  • 1
  • 7
  • 20
42
votes
9 answers

onShowFileChooser() from android webview works only once

I need to pick images from the device and upload it to the server. For the first time, when I pick the images, onShowFileChooser() gets called and everything works. But, when I try to click upload again, onShowFileChooser() never gets called. But…
Sangeetha Pinto
  • 1,022
  • 3
  • 14
  • 32
42
votes
2 answers

How to enable cookies in android webview?

How do I enable cookies in a webview? I tried to use CookieManager.getInstance().setAcceptCookie(true); just before calling WebView.loadUrl() and it doesn't work as I get an HTML page error from a website saying cookies need to be enabled. How does…
Jono
  • 17,341
  • 48
  • 135
  • 217
42
votes
16 answers

android webview displaying blank page

I have an android application that I am developing using the emulator running on android 2.3.3 with an embedded WebView in a framelayout nested in a linearlayout (vertical). No matter what code I use it never actually does anything. I have…
Chris White
  • 709
  • 1
  • 5
  • 8
41
votes
4 answers

How to retrieve HTML content from WebView (as a string)

How do I retrieve all HTML content currently displayed in a WebView? I found WebView.loadData() but I couldn't find the opposite equivalent (e.g. WebView.getData()) Please note that I am interested in retrieving that data for web pages that I have…
JohnK
  • 553
  • 1
  • 4
  • 8
41
votes
9 answers

Disable zoom on web-view react-native?

How to disable zoom on react-native web-view,is there a property like hasZoom={false}(just an example) that can be included in the below web-view tag that can disable zooming. It has to be working on both android and ios.
Amal p
  • 2,882
  • 4
  • 29
  • 49
41
votes
12 answers

WebView textarea doesn't pop up the keyboard

When I display a WebView, I don't see the soft keyboard popping up. The hard keyboard also doesn't work! What are the usual shortcomings. The code which I use to access the WebView is: package com.example.blahblah; import…
Sana
  • 9,895
  • 15
  • 59
  • 87
41
votes
3 answers

Android WebView Hardware Acceleration Artefact Workarounds

So there's a known bug with WebView hardware acceleration in Android, see here for example: https://code.google.com/p/android/issues/detail?id=17352 Disabling hardware acceleration is not an option for me. I've read these great references: Android…
Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231
40
votes
3 answers

Android webview loading data performance very slow

Hi I am working on one application, In that I am using Android WebView. Whenever I launch webview activity, loading data in string html format from test.txt file. test.txt file contains nearly 2.5 MB data, after loading test.txt file, if slide…
Android learner
  • 1,871
  • 4
  • 24
  • 36
40
votes
4 answers

In Android Webview, am I able to modify a webpage's DOM?

Suppose I load a 3rd party URL through webview. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webview = (WebView) findViewById(R.id.webview); …
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
40
votes
7 answers

Intercept POST requests in a WebView

I'm developping an Android application filtering the requests (with a white list) and using a custom SSLSocketFactory. For this, I've developed a custom WebViewClient and I have overridden the shouldInterceptRequest method. I can filter and use my…
Fab_34
  • 401
  • 1
  • 4
  • 4
39
votes
2 answers

What does "enable DOM storage API" mean?

I came across this Android WebView function WebSettings.setDomStorageEnabled(true) and from the name alone I can infer that it simply "enables DOM storage". The Android documentation, however, suggests something slightly different: Set whether the…
uTubeFan
  • 6,664
  • 12
  • 41
  • 65
39
votes
16 answers

SwipeRefreshLayout + WebView when scroll position is at top

I'm trying to use SwipeRefreshLayout with WebView. I'm facing the problem where in the middle of page, when user scrolls down, unwanted refresh kicks in. How do I make the refresh event only happen when webview's scroll position is at the top. (ie,…
eugene
  • 39,839
  • 68
  • 255
  • 489
39
votes
1 answer

Cancel loading in WebView on Android

How can I cancel a loading operation in WebView started by loadData() method?
Marek Stój
  • 4,075
  • 6
  • 49
  • 50
39
votes
5 answers

WebView Rendering Issue in Android KitKat

I've been working on an application which have a WebView in which a static page get loaded from the assets (Also using JavaScript). This WebView is not working in KitKat, it remains blank. I am aware of the change in rendering engine (webkit to…
gnuanu
  • 2,252
  • 3
  • 29
  • 42