@contentful/experiences-core 1.40.1 → 1.40.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1453,10 +1453,11 @@ const CF_DEBUG_KEY = 'cf_debug';
1453
1453
  * SecurityError (e.g. Brave or Chromium with specific settings).
1454
1454
  */
1455
1455
  const checkLocalStorageAvailability = () => {
1456
- if (typeof localStorage === 'undefined' || localStorage === null) {
1457
- return false;
1458
- }
1459
1456
  try {
1457
+ // Even the typeof check can throw an error in an agressive browser like Brave (requires using the deprecated flag #block-all-cookies-toggle)
1458
+ if (typeof localStorage === 'undefined' || localStorage === null) {
1459
+ return false;
1460
+ }
1460
1461
  // Attempt to set and remove an item to check if localStorage is enabled
1461
1462
  const TEST_KEY = 'cf_test_local_storage';
1462
1463
  localStorage.setItem(TEST_KEY, 'yes');