Skip to content

Instantly share code, notes, and snippets.

@chestozo
Created October 23, 2019 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chestozo/abc4d42175df61467f01de04549614d0 to your computer and use it in GitHub Desktop.
Save chestozo/abc4d42175df61467f01de04549614d0 to your computer and use it in GitHub Desktop.
(function() {
const methods = [ 'pushState', 'replaceState', 'back', 'forward', 'go' ]
const _originals = {}
methods.forEach((m) => {
_originals[m] = window.history[m]
window.history[m] = function() {
console.log('XXX', m, arguments)
return _originals[m].apply(window.history, arguments)
}
})
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment