webview

Bizarre Error related to Webview in Android App

拜拜、爱过 提交于 2020-01-07 03:00:13
问题 I have a string that I am fetching from a JSON response, the string is as follows: \u003cp\u003e\u003c/p\u003e\u003cdiv style=\"text-align: center;\"\u003e\r\n\u003cdiv\u003e\u003cimg src=\"http://8wayrun.com/rectangle.png\" alt=\"\" style=\"cursor: default;\"\u003e\u003c/div\u003e\r\n\u003cbr\u003e\r\n\u003cdiv\u003eThis is the central hub for many of the tournaments run on the 8WAYRUN.TV live stream.\u003c/div\u003e\r\n\u003cdiv\u003eYou can find our live stream at: \u003ca href=\"http:/

Android webview file browser opens but file not selectable

被刻印的时光 ゝ 提交于 2020-01-07 02:11:46
问题 HTML Input type file in my android webview was not working for me so I found this solution (File Upload in WebView) and implemented the same, now I am able to open file browser. But now the problem is I can't select file. Nothing happens on tapping on any file and its shown grayed out as well (like disabled). I've checked on android 5 & 6 both none of them is working for me. Also I have these line in my manifest <uses-permission android:name="android.permission.INTERNET"/> <uses-permission

Android Webview JNI ERROR with loadUrl

徘徊边缘 提交于 2020-01-07 01:58:07
问题 I'm writing an Android App which is opening a locally stored html file check.html . This html file is showing some nice text and then http-forwarding to my real wanted webpage. Now it can happen, that the server is down, or even the network is unplugged, but I want the app to keep trying to reach it all the time. In case that just the server is down, Android has some latency when asking for the webpage before returning to onReceivedError() , so I don't have a problem, but if the network is

Show special characters in a webview

假装没事ソ 提交于 2020-01-06 23:43:38
问题 I have a text (sInfoText) with a lots of special characters like 'è'. I would like to show this special character also in a webview, but I get rubbish characters. Howto convert this special characters programmatically? wvinfo.loadData(sInfoText,"text/html", "UTF-8"); 回答1: try wvinfo.loadData(sInfoText, "text/html; charset=UTF-8", null); this ll work on above 4.0.0 来源: https://stackoverflow.com/questions/27998872/show-special-characters-in-a-webview

How to clear the cache in webview chrome App?

落爺英雄遲暮 提交于 2020-01-06 17:10:29
问题 I am developing chrome app using webview(https://developer.chrome.com/apps/tags/webview) in chrome app with the following scenarios. show page content using offline cache file. app should not read cache file when app is in online. show custom reset method to clear the cache. I did 1st scenario, but I unable to reset the cache file when user is in online and also unable reset cache using custom method. I used the following documention https://developer.chrome.com/extensions/browsingData#method

Automatically jump to a certain part of a WebView

冷暖自知 提交于 2020-01-06 15:51:29
问题 I'm making a Chrome App, and i'm using the web view tag, which is similar to an iframe. Is there a way to load halfway down the webpage that's inside the web view? I have tried: <webview onLoad="window.scroll(0, 150)" class="test" src="http://example.co.uk/test.aspx"></webview> But it seems that would be far to easy. I'm not convinced its even possible. Thanks 回答1: Assuming for a moment that code would execute (it won't because of the CSP), window would refer to the app's page, not the

WebView adding and editing text as a link objective-C

谁都会走 提交于 2020-01-06 15:50:13
问题 I am creating a mac application and it requires to have a functionality the same as that is available in the Apple mail for adding and editing the urls in the mail. If I do the below, I get the problem that it does not detects the selected text as link DOMRange *selectedDomRange = [self.cannedResponseWebView selectedDOMRange]; DOMNode *commonNode = [selectedDomRange commonAncestorContainer]; DOMNode *parentNode = [commonNode parentNode]; NSString *linkDisplay = [[[parentNode attributes]

WebView is not opening google.com

浪尽此生 提交于 2020-01-06 15:03:13
问题 My webview is able to load both https & http sites But not https://www.google.com It doesn't throw any error either. Here is my code.I am unable to solve this problem super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Button btn = (Button) findViewById(R.id.Button1); final EditText et=(EditText)findViewById(R.id.EditText1); final WebView wv1=(WebView)findViewById(R.id.WebView1); wv1.getSettings().setJavaScriptEnabled(true); wv1.getSettings().setDomStorageEnabled

WebView is not opening google.com

独自空忆成欢 提交于 2020-01-06 15:02:10
问题 My webview is able to load both https & http sites But not https://www.google.com It doesn't throw any error either. Here is my code.I am unable to solve this problem super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Button btn = (Button) findViewById(R.id.Button1); final EditText et=(EditText)findViewById(R.id.EditText1); final WebView wv1=(WebView)findViewById(R.id.WebView1); wv1.getSettings().setJavaScriptEnabled(true); wv1.getSettings().setDomStorageEnabled

混合 App 打开 H5 调试开关

时光毁灭记忆、已成空白 提交于 2020-01-06 14:54:27
背景 随着现在移动端设备的硬件性能的提高,现在web页面的体验逐渐变得可以接受,现在很多的应用都采用的Hybrid开发模式,一方面有利用了原生设备的API的优势(性能好、用户体验好),另一方面利用了web开发的优势(跨平台,开发成本低)。比如微信、QQ、58同城、美团、爱奇艺等等应用都是采用的Hybrid开发模式。 Hybrid应用如何去做自动化呢? Hybrid是native嵌套了web,对于native页面,我们可以采用原生的自动化框架UIAutomator/XCUITest,而对于web页面,我们可以采用ChromeDriver,两者相结合完成自动化测试。现在流行的说法是移动端内嵌的web可以称为H5,虽然严格意义上来说H5不等同web。为了实现H5页面的自动化,其中H5页面的调试开关我们是必须要打开,否则通过inspector元素探测工具是定位不到页面的元素信息。 有源码的应用 针对公司内部团队开发的App,我们可以要开发直接在源代码中加上如下的代码,然后重新编译打一个debug包 if (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) { WebView.setWebContentsDebuggingEnabled(true); } 无源码的应用 对于无源码的应用,如第三方线上App