Skip to content

Instantly share code, notes, and snippets.

@ilhamgusti
Created March 9, 2021 02:48
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 ilhamgusti/783331442f7a943a0c7cda73276b47c1 to your computer and use it in GitHub Desktop.
Save ilhamgusti/783331442f7a943a0c7cda73276b47c1 to your computer and use it in GitHub Desktop.
simulate hard reload keypress
function shift_f5_hard_reload() {
let evt = new KeyboardEvent("keydown", {
shiftKey: true,
key: "f5",
keyCode: 116
});
document.dispatchEvent(evt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment