If a user clicks refresh or does f5 or refreshes by tab left click/reload then it is an intentional action!
Can a hacker inject a script maybe in an image src (but not to be too specific;) or anywhere else on the page, that forces a reload/redirect?
If so, is there something in the onbeforeunload event that will tell me that this was triggered by code?
WOW
window.onunload=function(e){console.dir(e);}
location.reload();
Event
Navigated to https://www.google.com/webhp?hl=en
Proof that Kaii is correct! I wonder why browser venders don't make an object of this event - to at least check if a refresh was user intention???