1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +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:
Tim Daubenschütz 2015-11-02 09:55:53 +01:00
parent 469f5108a8
commit 11f3ab51a3

View File

@ -23,36 +23,4 @@
* @type {bool} Is drag and drop available on this browser
*/
export const dragAndDropAvailable = 'draggable' in document.createElement('div') &&
!/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');
!/Mobile|Android|Slick\/|Kindle|BlackBerry|Opera Mini|Opera Mobi/i.test(navigator.userAgent);