FInding the webkit version used in Android browser

2019-04-04 23:15发布

Is there a way to tell which version of the webkit software is used in the Android browser on some specific handset?

What would be really great is if there is a URL you can browse to get that information. But any other way would be good too. If you know the webkit version, you know how much html5 suport to expect.

6条回答
迷人小祖宗
2楼-- · 2019-04-04 23:31
Bombasti
3楼-- · 2019-04-04 23:37

Also we can use

PackageInfo pi = getPackageManager().getPackageInfo("com.google.android.webview", 0);
String version = pi.versionName;
查看更多
Explosion°爆炸
4楼-- · 2019-04-04 23:49

When you type javascript:alert(navigator.userAgent) in the location bar you'll see the WebKit version listed e.g.

Emulator Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; GT-N8000 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30

查看更多
迷人小祖宗
5楼-- · 2019-04-04 23:49

There's a Javascript library from several years ago that can do this. Not sure how up-to-date it is: http://trac.webkit.org/wiki/DetectingWebKit

查看更多
乱世女痞
6楼-- · 2019-04-04 23:51

On Android 2.3.3, at least, the version of Webkit is reflected in the user agent string.

When I go to WhatsMyUserAgent.com on my Android device with 2.3.3 (Cyanogenmod 7.0.3), I get:

Mozilla/5.0 (Linux; U; Android 2.3.3; en-us; HTC Vision Build/FRF91) AppleWebKit/533.1 (KHTML; like Gecko) Version/4.0 Mobile Safari/533.1
查看更多
Animai°情兽
7楼-- · 2019-04-04 23:55
WebView webView = new WebView(getApplicationContext());
String useragent=webView.getSettings().getUserAgentString();

The useragent is the reuslt like:

Mozilla/5.0 (Linux; Android 4.4.2; SM-N900 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36

查看更多
登录 后发表回答