1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

Fix for missing version in iOS web apps

Also known as home screened app
This commit is contained in:
Sean Soria
2012-01-24 01:58:00 -08:00
parent 551f639021
commit cf3e634570
3 changed files with 31 additions and 29 deletions

View File

@@ -28,6 +28,7 @@
, gecko = /gecko\//i.test(ua)
, seamonkey = /seamonkey\//i.test(ua)
, webkitVersion = /version\/(\d+(\.\d+)?)/i
, o
function detect() {
@@ -40,19 +41,19 @@
, chrome: t
, version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}
if (iphone) return {
webkit: t
, iphone: t
, mobile: t
, ios: t
, version: ua.match(webkitVersion)[1]
}
if (ipad) return {
webkit: t
, ipad: t
, mobile: t
, ios: t
, version: ua.match(webkitVersion)[1]
if (iphone || ipad) {
o = {
webkit: t
, mobile: t
, ios: t
, iphone: iphone
, ipad: ipad
}
// WTF: version is not part of user agent in web apps
if (webkitVersion.test(ua)) {
o.version = ua.match(webkitVersion)[1]
}
return o
}
if (android) return {
webkit: t
@@ -70,7 +71,7 @@
, version: ua.match(webkitVersion)[1]
}
if (gecko) {
var o = {
o = {
gecko: t
, mozilla: t
, version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]