@fingerprintjs/fingerprintjs-pro-spa
Advanced tools
Comparing version 1.0.0 to 1.0.1
/** | ||
* FingerprintJS Pro SPA v0.7.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* FingerprintJS Pro SPA v1.0.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -253,3 +253,3 @@ */ | ||
var version = "0.7.0"; | ||
var version = "1.0.0"; | ||
@@ -262,2 +262,24 @@ const cacheLocationBuilders = { | ||
}; | ||
const doesBrowserSupportCacheLocation = (cacheLocation) => { | ||
switch (cacheLocation) { | ||
case exports.CacheLocation.SessionStorage: | ||
try { | ||
window.sessionStorage.getItem('item'); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
return true; | ||
case exports.CacheLocation.LocalStorage: | ||
try { | ||
window.localStorage.getItem('item'); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
return true; | ||
default: | ||
return true; | ||
} | ||
}; | ||
const cacheFactory = (location) => { | ||
@@ -293,2 +315,5 @@ return cacheLocationBuilders[location]; | ||
} | ||
if (!doesBrowserSupportCacheLocation(this.cacheLocation)) { | ||
this.cacheLocation = exports.CacheLocation.Memory; | ||
} | ||
cache = cacheFactory(this.cacheLocation)(options.cachePrefix); | ||
@@ -295,0 +320,0 @@ } |
/** | ||
* FingerprintJS Pro SPA v0.7.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* FingerprintJS Pro SPA v1.0.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -4,0 +4,0 @@ */ |
/** | ||
* FingerprintJS Pro SPA v0.7.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* FingerprintJS Pro SPA v1.0.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -229,3 +229,3 @@ */ | ||
var version = "0.7.0"; | ||
var version = "1.0.0"; | ||
@@ -238,2 +238,24 @@ const cacheLocationBuilders = { | ||
}; | ||
const doesBrowserSupportCacheLocation = (cacheLocation) => { | ||
switch (cacheLocation) { | ||
case CacheLocation.SessionStorage: | ||
try { | ||
window.sessionStorage.getItem('item'); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
return true; | ||
case CacheLocation.LocalStorage: | ||
try { | ||
window.localStorage.getItem('item'); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
return true; | ||
default: | ||
return true; | ||
} | ||
}; | ||
const cacheFactory = (location) => { | ||
@@ -269,2 +291,5 @@ return cacheLocationBuilders[location]; | ||
} | ||
if (!doesBrowserSupportCacheLocation(this.cacheLocation)) { | ||
this.cacheLocation = CacheLocation.Memory; | ||
} | ||
cache = cacheFactory(this.cacheLocation)(options.cachePrefix); | ||
@@ -271,0 +296,0 @@ } |
{ | ||
"name": "@fingerprintjs/fingerprintjs-pro-spa", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "FingerprintJS Pro JavaScript agent for Single-Page Applications (SPA)", | ||
@@ -5,0 +5,0 @@ "main": "dist/fp-pro-spa.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45289
894