简体   繁体   English

Android WebView javascript支持

[英]Android WebView javascript support

I am using Android's built in WebView to show something to the user. 我正在使用Android的内置WebView向用户显示某些内容。 I also insert custom javacsript to the page user is is viewing, since it's rather complicated javascript (lets call it userscript, because it acts like you are using for an example Chrome's a userscript on specific page only) Im interested what are the differences in Chromes WebView in different devices? 我还将自定义javacsript插入用户正在查看的页面,因为它是相当复杂的javascript(我们称其为userscript,因为它的行为就像您仅在特定页面上使用Chrome的用户脚本示例一样)我对Chrome中的区别有什么兴趣WebView在不同的设备上?

I guess they are using stock "browser" rendering, but what about javascript support, css3 support etc. on different devices. 我猜他们正在使用原始的“浏览器”渲染,但是在不同设备上的javascript支持,css3支持等等呢?

Just to be clear. 只是要清楚。

WebView on Android is actually a version of WebKit customised for the Android platform. Android上的WebView实际上是为Android平台定制的WebKit版本。 It's not a version of Chrome. 它不是Chrome版本。

Chrome for Android stays up to date as much as possible with desktop chrome. 适用于Android的Chrome浏览器始终使用台式机Chrome浏览器。

On iOS I believe the WebView is a single core version of the Safari browser so has some differences. 在iOS上,我认为WebView是Safari浏览器的单核版本,因此存在一些差异。

Chrome for iOS uses this WebView to display web content. Chrome for iOS使用此WebView来显示Web内容。

Regarding support best thing to do it look at sites such as http://caniuse.com/ 关于支持的最佳做法,请访问http://caniuse.com/等网站。

The Android WebView is the same as the "Android Stock Browser" that exists on many Android phones (but is oddly unavailable in Google's Nexus devices). Android WebView与许多Android手机上存在的“ Android Stock Browser”相同(但奇怪的是在Google的Nexus设备上不可用)。 This is true for rendering, JavaScript, etc. When you're looking at a site such as http://caniuse.com , the "Android" column is what you're looking for, not the "Chrome" column. 对于渲染,JavaScript等,这是正确的。当您查看诸如http://caniuse.com之类的网站时,“ Android”列就是您要查找的内容,而不是“ Chrome”列。

Unfortunately, testing on Chrome bears almost no relation to using a WebView on Android. 不幸的是,在Chrome上进行测试几乎与在Android上使用WebView没有任何关系。 Google has stated that they are working on a new WebView component that would be part of Chrome. 谷歌表示,他们正在开发一个新的WebView组件,该组件将成为Chrome的一部分。 I asked Google representatives directly when this would be available at PhoneGap Day last month, but all they could say is "it's coming". 我直接问Google代表什么时候可以在上个月的PhoneGap Day上使用它,但是他们只能说“即将到来”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM