【问题标题】:How to delete history entries added through history.pushstate?如何删除通过history.pushstate添加的历史条目?
【发布时间】:2013-09-25 02:03:53
【问题描述】:

我想完全删除通过history.pushState 添加的一些历史记录条目,而不是使用history.replaceState 来修改它们。我应该如何做到这一点?

【问题讨论】:

  • 我认为这是一个安全漏洞。

标签: javascript jquery html browser-history


【解决方案1】:

无法编辑以前的历史记录条目。来自历史文档:

在 History 接口上定义的所有属性的 getter 和 setter 以及所有方法,当在与未完全活动的 Document 关联的 History 对象上调用时,必须抛出 SecurityError 异常

http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#the-history-interface

【讨论】:

    猜你喜欢
    • 2011-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-19
    相关资源
    最近更新 更多