webview

Opening an activity with a webview containing a HTML5 video for a second time

血红的双手。 提交于 2020-01-06 04:02:05
问题 I am serving video's in a webview in Android using Appcelerator Titanium. On iOS this works like a charm. But on Android this gives some problems. It goes wrong the second time an activity is opened with a webview that holds a html5 video element. Steps to reproduce: (Also see this youtube video: http://www.youtube.com/watch?v=0MpSpfJNyOk ) The first time opening a video/activity with html5 video it shows the video and I am able to play it. When I close the window/activity and open a new

How to Programmatically Scroll UWP WebView?

青春壹個敷衍的年華 提交于 2020-01-06 02:21:30
问题 I'm making a simply UWP (Universal Windows 10 App) web app using a webview. How can I return on the top of the page clicking on a button? I can't find it on the MSDN. 回答1: You can use window.scrollTo(0,0) method, it is a JavaScript method that scrolls the document to position "0" horizontally and "0" vertically. You can interact with the content of the WebView by using the InvokeScriptAsync method to invoke or inject script into the WebView content. For example: <Grid Background="

Android: Sending image URI from webview website to app

六眼飞鱼酱① 提交于 2020-01-06 02:14:07
问题 I'm trying to send an image URI from a Website canvas to application with Javascript. In the Website I'm using the following function that relies on the html2canvas plugin: $("div.imagecapture").click(function() { html2canvas(document.getElementById('paper_trolley_center'), { onrendered: function(canvas) { var strDataURI = canvas.toDataURL("image/jpeg"); console.log('La imagen: '+strDataURI); jsNativeInterface.metodoDemo1(strDataURI); } }); }); The console.log outputs the URI, but the

混合 App 打开 H5 调试开关

爱⌒轻易说出口 提交于 2020-01-06 01:29:12
背景 随着现在移动端设备的硬件性能的提高,现在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

Android webview check if page is in cache

十年热恋 提交于 2020-01-06 01:29:05
问题 in my app i'm using a webview to load a website for mobile devices. I've set up the webview for caching successfully. But if the device is offline and the user wants to visit a page which wasn't visited before it cannot be shown. This is clear because for a non visited page there is no counterpart in the cache. Therefore the webview shows the "Page not available" page. So to my question: Is it possible to check if a page exists in the cache before loading it in the webview? kind regards

JavaFX WebView doesn't execute JavaScript

旧街凉风 提交于 2020-01-05 21:12:30
问题 I am on Windows 8. I have a JavaFX app that creates a simple window with a webview control and loads the local file "test.html". "test.html" contains javascript (a simple "alert("hello");<(script>"). However, the javascript is ignored. What rendering engine does webview in JavaFX use? I have Firefox and IE installed. The latter executes JS contained in local files only if the users accepts to do so. So my assumption is that webview uses IE due to some configuration of my OS. Is this possible?

Android webview screenshot white border

女生的网名这么多〃 提交于 2020-01-05 19:31:25
问题 i followed this link to screenshot my webview completely. It works fine. But I have an issue. The screenhot that I get from the webview contains white spaces on the top and bottom of the picture? How do I get rid of this? Kindly let me know. This is the code that I've used for capturing from webview. IF YOU LOOK PROPERLY THERE IS WHITESPACE BOTH AT THE BOTTOM AND TOP PARTS OF THE IMAGE. public static String saveCapturedImageToSdCard() { Picture picture = WebViewActivity.sWebViewEx

Android webview screenshot white border

穿精又带淫゛_ 提交于 2020-01-05 19:30:29
问题 i followed this link to screenshot my webview completely. It works fine. But I have an issue. The screenhot that I get from the webview contains white spaces on the top and bottom of the picture? How do I get rid of this? Kindly let me know. This is the code that I've used for capturing from webview. IF YOU LOOK PROPERLY THERE IS WHITESPACE BOTH AT THE BOTTOM AND TOP PARTS OF THE IMAGE. public static String saveCapturedImageToSdCard() { Picture picture = WebViewActivity.sWebViewEx

Get WebView's content height - Windows Phone 8.1

梦想的初衷 提交于 2020-01-05 15:16:54
问题 I try to get the height of the actual HTML content inside my WebView in order to set the height according to the content. this is my script, but I get an empty string when the scripit is being invoked. private async Task LoadHTMLContent(ItemViewModel itemVm) { var htmlScript = "<script>function getDocHeight() { " + "return document.getElementById('pageWrapper').offsetHeight; } </script>"; var htmlConcat = string.Format("<html><head>{0}</head>" + "<body style=\"margin:0;padding:0;\" " + ">" +

Get WebView's content height - Windows Phone 8.1

纵饮孤独 提交于 2020-01-05 15:16:46
问题 I try to get the height of the actual HTML content inside my WebView in order to set the height according to the content. this is my script, but I get an empty string when the scripit is being invoked. private async Task LoadHTMLContent(ItemViewModel itemVm) { var htmlScript = "<script>function getDocHeight() { " + "return document.getElementById('pageWrapper').offsetHeight; } </script>"; var htmlConcat = string.Format("<html><head>{0}</head>" + "<body style=\"margin:0;padding:0;\" " + ">" +