Skip to content

Instantly share code, notes, and snippets.

@danieltxok
Created February 17, 2021 11:58
Show Gist options
  • Save danieltxok/3329773d2a14c58e7026af60c05a311d to your computer and use it in GitHub Desktop.
Save danieltxok/3329773d2a14c58e7026af60c05a311d to your computer and use it in GitHub Desktop.
Deletes previous page load
javascript:
document.documentElement.innerHTML = '';
for (const obj of [document, window]) {
for (const event of Object.values(getEventListeners(obj))) {
for (const {type, listener, useCapture} of event) {
obj.removeEventListener(type, listener, useCapture)
}
}
}
console. clear();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment