I want to check when someone tries to refresh a page.
For example, when I open a page nothing happens but when I refresh the page it should display an alert.
Append the below Script in Console:
window.addEventListener("beforeunload", function(event) { console.log("The page is redirecting") debugger; });