android-webview

How do I navigate within a webview with the help of a locally imported js file?

爷,独闯天下 提交于 2019-12-24 01:05:53
问题 I am working on a webview that calls a url from webserver, such that url = abc.com/thispage which is a http: link Now inside that this page, i am navigating futher to another page ,say "mainpage", i would like to import a local js file which I have written such that: steps: 1) I import the myjspage.js file to the project (done in assets ) 2) Append "_$page_on=1" parameter to the requested url. 3) Read data from myjspage.js file and inject into webcontrol after page is loaded. 4) Intercept url

How do I navigate within a webview with the help of a locally imported js file?

霸气de小男生 提交于 2019-12-24 01:02:59
问题 I am working on a webview that calls a url from webserver, such that url = abc.com/thispage which is a http: link Now inside that this page, i am navigating futher to another page ,say "mainpage", i would like to import a local js file which I have written such that: steps: 1) I import the myjspage.js file to the project (done in assets ) 2) Append "_$page_on=1" parameter to the requested url. 3) Read data from myjspage.js file and inject into webcontrol after page is loaded. 4) Intercept url

Android WebView NOT launching new browser

柔情痞子 提交于 2019-12-23 22:19:14
问题 Previously when using a webview in android, clicking any link would force the "proper" browser to open and then web browsing would continue in that instance. However this seems to no longer be the case. The following code results in all links staying inside the webview, but I actually want the links to launch a new browser instance. Did this change in 2.3 ? Note I am asking the opposite of what most people ask (they ask how to keep all links inside the webview, I want them to launch outside)

Image not loading through android webview

 ̄綄美尐妖づ 提交于 2019-12-23 20:13:06
问题 I have a webview that loads a webpage and sometimes in this webpage there are pictures. However, i have encountered 2 instances where the image does not load and they each give different outcome. Outcome #1 : Webpage is loaded but image is not loaded (Format used : .jpeg) Outcome #2 : Webpage is loaded but image is not loaded. However, at where the image should be, there is a icon with a question mark. (Format used : .jpg) I have other webpages that have images of the same format and from the

Using WebView for multi-page login to website and fetch data

跟風遠走 提交于 2019-12-23 19:45:56
问题 I'm building an Android app as a mobile client for a website that does not (and will not) have it's own UI for mobile browsers. My chosen architecture uses a hidden WebView which I initialise (loadURL) with the login page, and then I load JavaScript to populate the login pages (there are two) with the user's name, password and other credentials. Once logged in, I'll navigate to a new URL and then use a JavaScriptInterface to extract sections of HTML from the pages for parsing and use in my

Enable experimental features in Android Chrome WebView - Aim: CSS Regions support for WebView

谁说我不能喝 提交于 2019-12-23 18:33:57
问题 Is it possible to enable Chrome Experimental Features in the new Android Chrome WebView like you can do in Chrome Browser (chrome://flags) ... I'm researching this because i'm searching for a way to get CSS Regions support in a WebView. Any other suggestion to get CSS Regions support is very welcome. Thanks in advance! 回答1: As of May 2017 (WebView version 57), this is officially not supported on retails builds. See this thread of the Android WebView Beta Channel, where the moderator says it

Ionic Android App - SSL Cert error - Primary Error - 5

大兔子大兔子 提交于 2019-12-23 17:55:31
问题 Few weeks ago, our app in our playstore stopped working on very few android devices. After debugging, we found out that the app isn't able to connect with our server due to cert validation failure. Our server certificates are very much valid. Don't know why it is not recognized by few devices all of a sudden. While debugging we tried to connect our app with another certificate chain which is cross-root enabled(to support SHA-1 and SHA-2), it worked well. Was there any security update in

Xamarin.Auth, WebView Clear Cookies on Android

别等时光非礼了梦想. 提交于 2019-12-23 16:15:37
问题 I've tried probably everything I could find online regarding clearing the cookies for an Android WebView using Xamarin.Auth. The Auth library does not expose the Android WebView; I cannot use its WebSettings nor clear the cache on that WebView object. Xamarin.Auth exposes a method for clearing cookies: public static void ClearCookies() { global::Android.Webkit.CookieSyncManager.CreateInstance(global::Android.App.Application.Context); global::Android.Webkit.CookieManager.Instance

Android webview loading html5 page from SD card with mp4 videos on various API

自闭症网瘾萝莉.ら 提交于 2019-12-23 15:08:09
问题 this is my first question on the forums. I'm building an app which implements a simple webview that loads an html5 page from the SD card. The app is a presentation made of 5 sections, and each section is contains some text overlayed on top of an HD video about 2 seconds long that plays in loop, basically acting like a page with a video background. The app runs fullscreen with automatic letterboxing / pillarboxing depending on the video resolution and orientation. On Chrome (Windows 7) and

Listen for URL fragment id change in WebView

房东的猫 提交于 2019-12-23 14:52:13
问题 It seems that the WebViewClient methods such as shouldInterceptRequest(), onPageStarted(), and shouldOverrideUrlLoading() only listen for URL changes that cause the WebView to load a new page. Is there a way to detect URL changes for fragment IDs, i.e. index.html#fragment_id, on a WebView? 回答1: I know that this is a really old question but i found out a solution that isn't available anywhere in Stack Overflow. jpetitto's answer works but it messes up javascript if we use hash change for