Created
April 26, 2022 19:34
-
-
Save doronguttman/15e58e51871ec095c6a2f38df20963d4 to your computer and use it in GitHub Desktop.
Find what code touches url history state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const org = history; | |
const keys = ["pushState", "replaceState"]; | |
keys.forEach(k => { | |
const desc = Object.getOwnPropertyDescriptor(history, k); | |
const value = desc.value; | |
delete desc.value; | |
delete desc.writable; | |
desc.get = function() { | |
debugger; | |
return value; | |
} | |
Object.defineProperty(org, k, desc); | |
}); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment