Javascript 在firefox/chrome中禁用历史api

Javascript 在firefox/chrome中禁用历史api,javascript,google-chrome,firefox,history.js,Javascript,Google Chrome,Firefox,History.js,我想在firefox中禁用history api,因此history.js将使用带有散列的回退机制。这样可以避免使用IE测试/开发回退功能 谢谢伊恩,对不起。我看错你了。是的,设置为null有效。现在的问题是,history.js自己进行测试以确定history api的可用性。模拟我发现的散列回退的唯一方法是修补历史库:window.history=null;删除window.history?此属性似乎不可删除。在您的代码之后,属性仍然存在。实际上,不要执行删除窗口。历史记录部分此代码仍然更改

我想在firefox中禁用history api,因此history.js将使用带有散列的回退机制。这样可以避免使用IE测试/开发回退功能


谢谢伊恩,对不起。我看错你了。是的,设置为null有效。现在的问题是,history.js自己进行测试以确定history api的可用性。模拟我发现的散列回退的唯一方法是修补历史库:

window.history=null;删除window.history?此属性似乎不可删除。在您的代码之后,属性仍然存在。实际上,不要执行
删除窗口。历史记录
部分此代码仍然更改url:delete window.history;window.history.pushState({},“title”,“/newpath”);我说不要包括
delete window.history零件。仅执行
window.history=null…然后尝试访问
窗口。历史记录
历史记录