mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Revert "Implement functionality for feature-detecting webStorage"
This reverts commit c7ef23ee40
.
Conflicts:
js/utils/feature_detection_utils.js
This commit is contained in:
parent
469f5108a8
commit
11f3ab51a3
@ -24,35 +24,3 @@
|
|||||||
*/
|
*/
|
||||||
export const dragAndDropAvailable = 'draggable' in document.createElement('div') &&
|
export const dragAndDropAvailable = 'draggable' in document.createElement('div') &&
|
||||||
!/Mobile|Android|Slick\/|Kindle|BlackBerry|Opera Mini|Opera Mobi/i.test(navigator.userAgent);
|
!/Mobile|Android|Slick\/|Kindle|BlackBerry|Opera Mini|Opera Mobi/i.test(navigator.userAgent);
|
||||||
|
|
||||||
/**
|
|
||||||
* Function that detects whether localStorage/sessionStorage is both supported
|
|
||||||
* and available.
|
|
||||||
* Taken from:
|
|
||||||
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
|
|
||||||
*
|
|
||||||
* We're explicitly NOT exporting this function, as we want for both localStorage, as well as
|
|
||||||
* sessionStorage proxy functions to be exported.
|
|
||||||
*
|
|
||||||
* @param {oneOfType(['localStorage', 'sessionStorage'])}
|
|
||||||
* @return {bool} Is localStorage or sessionStorage available on this browser
|
|
||||||
*/
|
|
||||||
function storageAvailable(type) {
|
|
||||||
try {
|
|
||||||
var storage = window[type],
|
|
||||||
x = '__storage_test__';
|
|
||||||
storage.setItem(x, x);
|
|
||||||
storage.removeItem(x);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Const that detects whether sessionStorage is both supported
|
|
||||||
* and available.
|
|
||||||
*/
|
|
||||||
export const sessionStorageAvailable = storageAvailable('sessionStorage');
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user