7 ms·
When I navigate back to HN after reading the article, I get a page 'more stories before you go'. At least the first time I opened the link. How is 538 able to
by smhg 4y ago
When I navigate back to HN after reading the article, I get a page 'more stories before you go'. At least the first time I opened the link.
How is 538 able to intercept my navigation away from their page?
- fyzix 4y agoI think google should factor this in pagerankings. Might be the only thing that can force change
- kmonsen 4y agoI feel like every site is doing it these days. Wonder if browsers should start blocking it.
- xwdv 4y agoJavaScript
- dclowd9901 4y agoSpecifically, in Javascript you can superficially push a navigated state into the location stack so that when the user presses the back button, it is now the inserted page instead of the “actual” one. Most FE devs consider this a dark pattern and refuse to implement it. That said, it’s basically just the front end’s version of a redirect. Unfortunately it’s been used a lot especially by malware sites to basically jail people into their site.
- bscphil 4y ago> Most FE devs consider this a dark pattern and refuse to implement it. How common is it for FE devs to refuse to implement features that their employers tell them to implement?
- halfmatthalfcat 4y agoI tried to when I worked at The Huffington Post a long time ago and was ridiculed. Some people don't care so they can point to increased metrics, ethics be damned.
- rvr_ 4y agohttps://www.w3schools.com/jsref/event_onbeforeunload.asp https://www.w3schools.com/jsref/event_onbeforeunload.asp
- smhg 4y agoI'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.
- usmannk 4y agoIt’s not that, they’re pushing the “before you go” page to the history stack. https://developer.mozilla.org/en-US/docs/Web/API/History/pushState https://developer.mozilla.org/en-US/docs/Web/API/History/pus... You can see it if you right click the back button after navigating to the article.
- graderjs 4y agoNo, 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