有没有办法使WebView小部件使用Chrome而不是Samsung/LG Android Phone上的内置WebKit浏览器? [英] Is there a way to make the WebView widget use Chrome instead of the builtin WebKit browser on Samsung/LG Android Phones?

查看:154
本文介绍了有没有办法使WebView小部件使用Chrome而不是Samsung/LG Android Phone上的内置WebKit浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android应用程序中使用WebView时-Android将在后台使用不同的浏览器来呈现网页.例如,三星设备上的Android 4.4之前的版本将使用三星股票电话附带的基于WebKit的浏览器(即使已安装Chrome,并且它是默认的网络浏览器). Google Nexus/HTC手机已预装了Chrome,并将使用它来呈现Web内容.

When using the WebView in an Android application - Android will utilize different browsers under the hood in order to render the web page. For example - pre Android 4.4 on Samsung devices will use the WebKit based browser that comes on Samsung stock phone (even if Chrome is installed and is the default web browser). Google Nexus/HTC phones come with Chrome pre-installed and they will use it to render web content.

在具有Google云端硬盘之类的网站的Samsung/LG设备上,WebKit浏览器存在渲染问题.在Chrome中的同一设备上打开时-它们可以完美呈现,但是在我们的应用程序(使用内置浏览器)中呈现时-它们无法呈现内容.

We have rendering problems with the WebKit browser on Samsung/LG devices with sites like Google Drive. When opened on the same device in Chrome - they render perfectly but when rendered in our application (which uses the builtin browser) - they fail to render the content.

我正在寻找一种使WebView使用Chrome(如果已安装)而不是设备上的内置浏览器的方法.

I'm looking for a way to make the WebView use Chrome (if installed) instead of the builtin browser on the devices giving me problems.

任何人都可以帮忙吗?

推荐答案

在Android应用程序中使用WebView时-Android将在后台使用不同的浏览器来呈现网页.

When using the WebView in an Android application - Android will utilize different browsers under the hood in order to render the web page.

否,WebView使用不同的Web呈现引擎,而不是不同的浏览器.

No, WebView uses different Web rendering engines, not different browsers.

例如-三星设备上的Android 4.4之前的版本将使用三星股票电话附带的基于WebKit的浏览器(即使已安装Chrome,并且它是默认的网络浏览器).

For example - pre Android 4.4 on Samsung devices will use the WebKit based browser that comes on Samsung stock phone (even if Chrome is installed and is the default web browser).

否,WebView将在所有4.4之前的设备上使用WebKit,而不是基于WebKit的浏览器".

No, WebView will use WebKit on all pre-4.4 devices, not "the WebKit based browser".

Google Nexus/HTC手机已预装了Chrome,并将使用它来呈现Web内容.

Google Nexus/HTC phones come with Chrome pre-installed and they will use it to render web content.

否,WebView会在所有4.4之前的设备(而不是Chrome)上使用WebKit,无论其品牌或型号如何,除非制造商进行大量修改.我可以肯定地说,4.4年前的Nexus系列设备没有这种修改.

No, WebView will use WebKit on all pre-4.4 devices, not Chrome, regardless of make or model, barring some massive manufacturer-specific modifications. I can positively state that no such modifications existed on Nexus-series devices of pre-4.4 vintage.

我正在寻找一种使WebView使用Chrome(如果已安装)而不是设备上的内置浏览器的方法.

I'm looking for a way to make the WebView use Chrome (if installed) instead of the builtin browser on the devices giving me problems.

那是不可能的.欢迎您使用其他Web渲染引擎进行调查(例如,查看Mozilla的GeckoView的发展情况,查看是否可以将Chromium端口移植到Android应用中),但是在Android 4.4之前,没有任何概念WebView本身使用其他引擎.您将需要使用一些其他API来显示Web内容,并将其绑定到其他呈现引擎.另外请注意,使用其他Web渲染库会大大增加您的应用大小.

That is not possible. You are welcome to investigate using some other Web rendering engine (e.g., see how Mozilla's GeckoView is coming along, see if there is a Chromium port to Android that you can bake into your app), but prior to Android 4.4, there is no notion of WebView itself using some other engine. You would need to use some other API for displaying Web content, tied to the other rendering engine. Also note that using another Web rendering library will significantly increase your app size.

这篇关于有没有办法使WebView小部件使用Chrome而不是Samsung/LG Android Phone上的内置WebKit浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆