webview

探索小程序实现

♀尐吖头ヾ 提交于 2020-01-05 13:55:39
随着小程序的发展与功能的逐步完善,越来越多的产品需要小程序与 APP 的功能能有一些共性,社区跨平台的解决方案越来越多,比如 taro 等为代表的把一套代码编译成多端运行的机制,本文会使用 Swift 作为原生语言,在 iOS 应用上运行一个小程序 Demo, 使用 Android && React Native 也可以采用同样的思路实现。 相关代码仓库: https://github.com/taixw2/rmini 编译层 编译的目的是为了抹平小程序的与 H5 的差异,利用 Vue 实现数据绑定,利用 Web Component 实现小程序的组件功能。 从官网文档中可以看出来,运行一个小程序需要框架(数据绑定渲染)、组件(小程序渲染单元)、api(与原始交互的能力)。 框架实现 转换成单页应用(一种可行的方案) 把所有页面打包成一个 js, 再由 js 管理所有的路由和状态,这种方案适合在 web 端运行,并且是单引擎的方案,在模拟原生的右滑返回等效果也会不尽人意。 转换成多页面 众所周知,小程序是一个双引擎的框架,上面的方案显然不能达到要求, 双引擎的特点是在运行 javascript 的黑盒子中,无法访问到 DOM && BOM 等。将所有的逻辑代码在原生的 JavascriptCore 中运行,WebView 中的 Javascript 引擎负责数据绑定,需要解决的难点是

WebView.CapturePreviewToStreamAsync() fails, but only on HoloLens with Unity3D

廉价感情. 提交于 2020-01-05 08:47:06
问题 Currently, we're trying to combine the use of Unity3D holograms and HTML rendering in one app. The idea works as follows: 1) start a XAML app whose main window contains a WebView component (using the XAML app template) 2) Switch to Holographic (DirectX) mode (essentially copy over the code from the Holographic app template) 3) The WebView still runs in the background 4) We can call the WebView.Navigate() method 5) Render the contents of the WebView via the CapturePreviewToStreamAsync() API to

WebView in Flutter Web

五迷三道 提交于 2020-01-05 08:34:47
问题 I am trying to display a web view in Flutter for Web but I got the following error : PlatformException(Unregistered factory, No factory registered for viewtype 'plugins.flutter.io/webview', null) Is there a way to display a WebView in Flutter Web ? 回答1: You need at first perform platformViewRegistry: ui.platformViewRegistry.registerViewFactory( 'hello-world-html', (int viewId) => IFrameElement() ..width = '640' ..height = '360' ..src = 'https://www.youtube.com/embed/IyFZznAk69U' ..style

Android WebView shows blank screen

╄→гoц情女王★ 提交于 2020-01-05 08:32:20
问题 I'm trying to create a WebView app that shows a meteor web app using Tiago Scolari's sample. When i load the apk in my phone i see the background changes but the log in button doesn't show. Anyone has a clue how to make this work? --Edit: Adding - webSettings.setJavaScriptCanOpenWindowsAutomatically(true); webSettings.setDomStorageEnabled(true); - shows me the log in button and gets me to the facebook log in. After logging in using facebook i'm presented with a white screen. Any more advice?

Cocoa WebView on os X not firing mouse hover events without having to click and hold left mouse key

我的梦境 提交于 2020-01-05 08:17:30
问题 I am new to Mac development and am trying to incorporate the use of a Cocoa WebView using the QMacCocoaViewContainer. I have the view loading my html file with multiple css and javascript files but the issue I am having is that the mouse hover events are not triggered when the user moves the mouse over the view. I have identified that if the user clicks and holds the left mouse button and moves the mouse then the events are triggered. I am guessing that it is a focus issue but have had no

How to show up interstrial ads, while opening two different URL in webview with Intent?

女生的网名这么多〃 提交于 2020-01-05 07:50:14
问题 So i am using intent to load two URL's from single web view with the help of switch case. Now i want to implement, intrestrial ads to show when anyone clicks on button before webview is loaded. Below is my code. """Home Activity"" public class home extends AppCompatActivity { AdView mAdview3; private InterstitialAd interstitialAd; public RatingBar ratingbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home

parent.opener doesn't work in webview Android

与世无争的帅哥 提交于 2020-01-05 06:55:17
问题 I have a problem. I need to return to parent Url from Frame opened in a Android Webview . The sequence is: Open inside Webview new frame. Select in frame options and paramters. Call in frame javascript function like _"javascript:parent.opener. jsfunction "_. Parent Web doesn't open... I don't have access to Web. I work only in Android side. I test Web in a firefox for Android and it works. Need help. 回答1: By default, WebView doesn't support multiple windows. If you check, I believe the parent

parent.opener doesn't work in webview Android

谁说我不能喝 提交于 2020-01-05 06:55:13
问题 I have a problem. I need to return to parent Url from Frame opened in a Android Webview . The sequence is: Open inside Webview new frame. Select in frame options and paramters. Call in frame javascript function like _"javascript:parent.opener. jsfunction "_. Parent Web doesn't open... I don't have access to Web. I work only in Android side. I test Web in a firefox for Android and it works. Need help. 回答1: By default, WebView doesn't support multiple windows. If you check, I believe the parent

Android TalkBack reading phone numbers in Webview incorrectly

こ雲淡風輕ζ 提交于 2020-01-05 05:26:08
问题 I'm having a minor headache with the TalkBack screen reader service when reading phone numbers in a WebView, and I can't seem to find a solution. This is a snippet of some html code that I am reading into the WebView: <li>Call <a href="tel:18007848669">1-800-QUIT-NOW(1-800-784-8669)</a> for phone support</li> The screen reader reads this as "Call one to eight hundred quit now one to eight hundred link". Is there a way to force it/signal to read it differently? I need it to be read in a more

Passing data between WebView and host application

ぃ、小莉子 提交于 2020-01-05 04:29:09
问题 I'm starting development of mobile application connected to web project that let's patients take notes of their bleedings. On web the user can click and select certain places on few human figures. One with some selection looks like this I don't really think this would be easy to achieve using standard controls(?), so I thought it would be the easiest to use a WebView that would host the piece of code that handles selection. To set the locations e.g when user wants to edit old bleeding I could