@awesome-cordova-library/device
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -89,9 +89,13 @@ "use strict"; | ||
var offset; | ||
if ((offset = userAgent.indexOf('Edge')) !== -1) { | ||
if (userAgent.indexOf('Edge') !== -1) { | ||
offset = userAgent.indexOf('Edge'); | ||
returnVal = getModel ? 'Edge' : userAgent.substring(offset + 5); | ||
} | ||
else if ((offset = userAgent.indexOf('Chrome')) !== -1) { | ||
else if (userAgent.indexOf('Chrome') !== -1) { | ||
offset = userAgent.indexOf('Chrome'); | ||
returnVal = getModel ? 'Chrome' : userAgent.substring(offset + 7); | ||
} | ||
else if ((offset = userAgent.indexOf('Safari')) !== -1) { | ||
else if (userAgent.indexOf('Safari') !== -1) { | ||
offset = userAgent.indexOf('Safari'); | ||
console.log(offset); | ||
if (getModel) { | ||
@@ -102,3 +106,4 @@ returnVal = 'Safari'; | ||
returnVal = userAgent.substring(offset + 7); | ||
if ((offset = userAgent.indexOf('Version')) !== -1) { | ||
if (userAgent.indexOf('Version') !== -1) { | ||
offset = userAgent.indexOf('Version'); | ||
returnVal = userAgent.substring(offset + 8); | ||
@@ -108,14 +113,22 @@ } | ||
} | ||
else if ((offset = userAgent.indexOf('Firefox')) !== -1) { | ||
else if (userAgent.indexOf('Firefox') !== -1) { | ||
offset = userAgent.indexOf('Firefox'); | ||
returnVal = getModel ? 'Firefox' : userAgent.substring(offset + 8); | ||
} | ||
else if ((offset = userAgent.indexOf('MSIE')) !== -1) { | ||
else if (userAgent.indexOf('MSIE') !== -1) { | ||
offset = userAgent.indexOf('MSIE'); | ||
returnVal = getModel ? 'MSIE' : userAgent.substring(offset + 5); | ||
} | ||
else if ((offset = userAgent.indexOf('Trident')) !== -1) { | ||
else if (userAgent.indexOf('Trident') !== -1) { | ||
offset = userAgent.indexOf('Trident'); | ||
returnVal = getModel ? 'MSIE' : '11'; | ||
} | ||
if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) { | ||
if (returnVal.indexOf(';') !== -1) { | ||
offset = returnVal.indexOf(';'); | ||
returnVal = returnVal.substring(0, offset); | ||
} | ||
else if (returnVal.indexOf(' ') !== -1) { | ||
offset = returnVal.indexOf(' '); | ||
returnVal = returnVal.substring(0, offset); | ||
} | ||
return returnVal; | ||
@@ -122,0 +135,0 @@ }; |
{ | ||
"name": "@awesome-cordova-library/device", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "This plugin defines a global device object, which describes the device's hardware and software. Although the object is in the global scope, it is not available until after the deviceready event.", | ||
@@ -49,3 +49,3 @@ "main": "lib/index.js", | ||
"lint": "tslint -p tsconfig.json", | ||
"repo:publish": "npm publish --access public" | ||
"repo:publish": "npm run build; npm publish --access public" | ||
}, | ||
@@ -52,0 +52,0 @@ "directories": { |
13758
275