cloudinary-core
Advanced tools
Comparing version 2.12.1 to 2.12.2
{ | ||
"name": "cloudinary-core", | ||
"version": "2.12.1", | ||
"version": "2.12.2", | ||
"description": "Cloudinary Client Side JS library. Cloudinary streamlines your web application’s image manipulation needs. Cloudinary's cloud-based servers automate image uploading, resizing, cropping, optimizing, sprite generation and more.", | ||
@@ -5,0 +5,0 @@ "main": "cloudinary-core.js", |
@@ -6,4 +6,9 @@ /** | ||
// User agent example taken from Safari desktop: | ||
const useAgent = navigator && navigator.userAgent || ''; | ||
/** | ||
* Retrieve from the navigator the user agent property. | ||
* @returns user agent property. | ||
*/ | ||
function getUserAgent(){ | ||
return navigator && navigator.userAgent || ''; | ||
} | ||
@@ -15,3 +20,4 @@ /** | ||
export function isAndroid(){ | ||
return (/Android/i).test(useAgent); | ||
const userAgent = getUserAgent(); | ||
return (/Android/i).test(userAgent); | ||
} | ||
@@ -24,3 +30,4 @@ | ||
export function isEdge(){ | ||
return (/Edg/i).test(useAgent); | ||
const userAgent = getUserAgent(); | ||
return (/Edg/i).test(userAgent); | ||
} | ||
@@ -33,3 +40,4 @@ | ||
export function isChrome(){ | ||
return !isEdge() && ((/Chrome/i).test(useAgent) || (/CriOS/i).test(useAgent)); | ||
const userAgent = getUserAgent(); | ||
return !isEdge() && ((/Chrome/i).test(userAgent) || (/CriOS/i).test(userAgent)); | ||
} | ||
@@ -45,3 +53,4 @@ | ||
// Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 | ||
return (/Safari/i).test(useAgent) && !isChrome() && !isAndroid() && !isEdge(); | ||
const userAgent = getUserAgent(); | ||
return (/Safari/i).test(userAgent) && !isChrome() && !isAndroid() && !isEdge(); | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
2064769
24548