Javascript 如何在google chrome中禁用web存储?
我已经尝试在Javascript 如何在google chrome中禁用web存储?,javascript,google-chrome,Javascript,Google Chrome,我已经尝试在about:about页面上找到一个标志,但没有找到 我还尝试用——禁用本地存储开关启动chrome。 但web存储仍然可用 我使用以下javascript代码检查它是否可用: if (storageAvailable('sessionStorage')) { console.log("Web Storage available"); } else { console.warn("Web Storage not available!"); } function stora
about:about
页面上找到一个标志,但没有找到
我还尝试用——禁用本地存储开关启动chrome。
但web存储仍然可用
我使用以下javascript代码检查它是否可用:
if (storageAvailable('sessionStorage')) {
console.log("Web Storage available");
}
else {
console.warn("Web Storage not available!");
}
function storageAvailable(type)
{
try {
var storage = window[type],
x = '__storage_test__';
storage.setItem(x, x);
storage.removeItem(x);
return true;
}
catch(e) {
return false;
}
}
我可以通过以下两个开关启动chrome来解决这个问题:
--禁用本地存储
--禁用会话存储
“C:\ProgramFiles(x86)\Google\Chrome\Application\Chrome.exe”
--禁用本地存储--禁用会话存储
当cookies被禁用时,网络存储通常被禁用。但我只需要禁用网络存储,我需要cookies。