Comparing version 0.2.4 to 0.2.5
{ | ||
"name": "crosstab", | ||
"version": "v0.2.4", | ||
"version": "v0.2.5", | ||
"homepage": "https://github.com/tejacques/crosstab", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "crosstab", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "A utility library for cross-tab communication using localStorage.", | ||
@@ -5,0 +5,0 @@ "author": "Tom Jacques <tejacques@gmail.com>", |
/*! | ||
* crosstab JavaScript Library v0.2.4 | ||
* crosstab JavaScript Library v0.2.5 | ||
* https://github.com/tejacques/crosstab | ||
@@ -25,2 +25,15 @@ * | ||
// When Safari on OS X or iOS is in private browsing mode, | ||
// calling localStorage.setItem throws an exception. | ||
// | ||
// "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made | ||
// to add something to storage that exceeded the quota." | ||
var setItemAllowed = true; | ||
try { | ||
localStorage.setItem('__crosstab', ''); | ||
localStorage.removeItem('__crosstab'); | ||
} catch (e) { | ||
setItemAllowed = false; | ||
} | ||
// Other reasons | ||
@@ -45,2 +58,5 @@ var frozenTabEnvironment = false; | ||
} | ||
if (!setItemAllowed) { | ||
reasons.push('localStorage.setItem not allowed'); | ||
} | ||
@@ -451,3 +467,3 @@ if (reasons.length > 0) { | ||
crosstab.id = util.generateId(); | ||
crosstab.supported = !!localStorage && window.addEventListener && !isMobile; | ||
crosstab.supported = !!localStorage && window.addEventListener && !isMobile && setItemAllowed; | ||
crosstab.util = util; | ||
@@ -489,3 +505,3 @@ crosstab.broadcast = broadcast; | ||
var TAB_TIMEOUT = 5 * 1000; | ||
// 100 ms ping timeout | ||
// 500 ms ping timeout | ||
var PING_TIMEOUT = 500; | ||
@@ -640,3 +656,3 @@ | ||
}; | ||
factory(require, module.exports, module); | ||
@@ -643,0 +659,0 @@ context[name] = module.exports; |
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
65504
1000