为什么 google chrome 不缓存搜索历史?
Why google chrome does not cache search history?
我在 chrome 中遇到了一个奇怪的行为,我不知道如何解决它。当我在页面之间浏览时,我发现 Google chrome 没有缓存我的搜索历史记录。看下图:
值得一提的是,页面之间的切换是由 javascript
下面的函数执行的:
window.location.replace({URL});
来自MDN docs for location.replace()
:
The Location.replace()
method replaces the current resource with the one at the provided URL. The difference from the assign()
method is that after using replace()
the current page will not be saved in session History, meaning the user won't be able to use the back button to navigate to it.
location.assign(url)
或 location.href = url
可能更适合您的情况。
我在 chrome 中遇到了一个奇怪的行为,我不知道如何解决它。当我在页面之间浏览时,我发现 Google chrome 没有缓存我的搜索历史记录。看下图:
值得一提的是,页面之间的切换是由 javascript
下面的函数执行的:
window.location.replace({URL});
来自MDN docs for location.replace()
:
The
Location.replace()
method replaces the current resource with the one at the provided URL. The difference from theassign()
method is that after usingreplace()
the current page will not be saved in session History, meaning the user won't be able to use the back button to navigate to it.
location.assign(url)
或 location.href = url
可能更适合您的情况。