我问这与Firefox有关,但也欢迎其他浏览器的解决方案!
如果我想重新加载页面,请按 F5 。
如果我想删除缓存并从服务器重新加载所有页面资源,请按 Ctrl + F5 。
这两种方法都不会导致浏览器从磁盘(~/.mozilla/firefox/foobar.profile/webappsstore.sqlite
)重新加载localStorage内容。
我对此功能的测试用例如下:
http://localhost:8080
),或者已打开网页。我打开控制台并运行:
window.localStorage.setItem("foo", "bar");
~/.mozilla/firefox/foobar.profile/webappsstore.sqlite
),并对localhost范围(UPDATE webappsstore2 SET value='baz' WHERE key='foo' AND scope='tsohlacol.:http:5000'
)中的键提交一些更改。我重新加载页面并运行:
window.localStorage.getItem("foo");
"baz"
返回。"bar"
已退回。我关闭Firefox,重新打开它并加载http://localhost:5000
。
我打开控制台并运行:
window.localStorage.getItem("foo");
"baz"
已退回。我的问题:为什么硬重装不会导致localStorage重新加载? 还有另一种方法吗?这是一个错误吗?