準備
コンテンツの設定 -> Cookie -> 例外設定
file:///*
を許可
jsで使えるかチェック
window.onload = function(){
if (storageCheck('localStorage')) {
// 使える場合
} else {
// 使えない場合
}
}
function storageCheck(type){
try {
var storage = window[type],
x = '__test__';
storage.setItem(x,x);
storage.removeItem(x);
return true;
} catch(e) {
return false;
}
}