Greasy Fork

Library: Additional <window> History-Stack Events (pushstate, replacestate)

To complement the <window> 'popstate' event, this library adds the 'pushstate'/'replacestate' events to <window>. Also adds corresponding 'onpushstate'/'onreplacestate' event handlers.

目前为 2022-06-14 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.icu/scripts/425774/1060686/Library%3A%20Additional%20%3Cwindow%3E%20History-Stack%20Events%20%28pushstate%2C%20replacestate%29.js

作者
sidneys
版本
0.1.0
创建于
2021-05-01
更新于
2022-06-14
大小
2.2 KB
许可证
暂无

Library

DOM Window History Stack Events (pushstate/replacestate)

  • Complement the 'popstate' event
  • Emits a pushstate event from window by Monkey-Patching History#pushState
  • Calls corresponding window#onpushstate event handler
  • Emits a replacestate event from window by Monkey-Patching HistoryreplaceState
  • Calls corresponding window#onreplacestate event handler