top | item 34038992

(no title)

rvr_ | 3 years ago

https://www.w3schools.com/jsref/event_onbeforeunload.asp

discuss

order

graderjs|3 years ago

No, it wouldn't be that. That can only prevent unload if it throws a native modal up (cousin of alert, confirm, prompt, etc).

I think what they must have done is push some URL to the history state, using the History API, to fuck with the back and forward buttons, enabling them to intercept when you navigate back, by having added an additional page in there, that you never visited, but that they can use to serve you this interstitial.

Just my 2c

smhg|3 years ago

I'm baffled any half decent site would use that. I expected some kind of new web/Chrome API.

That's a very "bold" choice of 538 if you ask me.