logoalt Hacker News

A new spam policy for “back button hijacking”

543 pointsby zdwtoday at 3:06 AM324 commentsview on HN

Comments

firefoxdtoday at 7:01 AM

Ok, you can start with LinkedIn, I'll wait...

If you are wondering how it works. You get a link from LinkedIn, it's from an email or just a post someone shared. You click on it, the URL loads, and you read the post. When you click the back button, you aren't taken back to wherever you came from. Instead, your LinkedIn feed loads.

How did it happen? When you landed on the first link, the URL is replaced with the homepage first (location.replace(...) doesn't change the browser history). Then the browser history state is pushed to the original link. So it seems like you landed on the home page first then you clicked on a link. When you click the back button, you are taken back to the homepage where your feed entices you to stay longer on LinkedIn.

show 11 replies
andreareinatoday at 5:18 AM

> Notably, some instances of back button hijacking may originate from the site's ... advertising platform

I feel like anything loaded from a third party domain shouldn't be allowed to fiddle with the history stack.

show 8 replies
Havoctoday at 9:57 AM

Great. Can we do ctrl-f search hijacking next.

So jarring when websites replace core functionality with their own broken crap because they think they’re special.

Some also seem to hijack right click menu now

show 4 replies
musicaletoday at 3:48 AM

The iron law of web encrapification: every web feature will (if possible) be employed to abuse the user, usually to push advertising.

show 5 replies
bityardtoday at 12:06 PM

As usual, it's a good first step but doesn't go far enough. I don't want my back-button hijacked by _anything_.

My issue with back-button hijacking isn't even spam/ads (I use an ad-blocker so I don't see those), but sites that do a "are you sure you want to leave? You haven't even subscribed to our newsletter yet?!"

show 2 replies
mixedbittoday at 1:01 PM

An interesting variant of a web phishing attack is to combine the back button hijacking with information that comes from the HTTP referer header. HTTP referer discloses from which website the user is coming from, when the user click the back button, the malicious site can take the user to the site that looks identical (except for the URL), but is attacker controlled.

p4bl0today at 5:49 AM

That's cool if they can make it work.

I don't understand how Google's indexing work anymore. I've had some website very well indexed for years and years which suddenly disappeared from the index with no explanation, even on the Search Console ("visited, not indexed"). Simple blog entries, lightweight pages, no JavaScript, no ads, no bad practices, https enabled, informative content that is linked from elsewhere including well indexed websites (some entries even performed well on Reddit). At the same time, for the past few years I've found Google search to be a less and less reliable tool because the results are less often what I need.

Anyway, let's hope this new policy can improve things a little.

show 1 reply
halfmatthalfcattoday at 1:55 PM

I remember when I worked at HuffPo and they started doing this. I called out the org and they all just shrugged.

al_borlandtoday at 3:45 AM

Some Microsoft sites have been very guilty of this. They are the ones that stick in my head in recent memory.

show 4 replies
bob1029today at 5:56 AM

This seems like a good time to advertise the post/redirect/get pattern.

https://en.wikipedia.org/wiki/Post/Redirect/Get

Not strictly about hijacking back navigation but it can make experience less bumpy if you've got form submissions in the middle of the path.

show 2 replies
wbshawtoday at 1:37 PM

Is there any click-bait news site that DOESN'T do this? You hit back and land on a list of their click-bait articles and add links instead of the page you expect.

htktoday at 2:01 PM

Popups were dealt in a way that could be useful here, they're only permitted when the user directly generates the interaction that creates the popup (not scripted). The back button could use the same algorithm back in history, only go back to screens that the user directly navigated.

cachvicotoday at 1:04 PM

I use Chrome on my Android and Mac. For a while I've appreciated the seemingly built-in anti-hijacking measure that always does what I expect on the second Back press. (The first Back may pop up a subscription box for example, but the second will always return me to where I came from).

I actually felt that this was a solved problem, so I'm surprised to see so many people still suffer getting stuck in redirect loops.

SCdFtoday at 10:34 AM

Ironically the only place I encounter this is using google news, where news sites seem to detect you're in google news (I don't think these same sites do it when I'm just browing normally?), and try to upsell you their other stories before you go back to the main page.

snowwrestlertoday at 12:39 PM

Wait, how does one website (google.com) know what happens inside my browsing session on another website (bad-blog.com) after I click over? Hmmmmm

This sort of announcement just emphasizes the extent to which Google observes ALL your web browsing behavior, thanks primarily to their eyes inside Chrome browser.

You know those warnings when you install a browser extension, about all the things that extension will be able to see and do? Well so can Chrome itself…

show 2 replies
cneestoday at 1:10 PM

It's about time. Google is doing so much to keep the web usable. They're the only ones with the teeth to back up standards for mobile web load time, max sender spam rates, leaving browser history alone, etc.

show 1 reply
slurpybtoday at 6:04 AM

Porno sites do this thing where every click is a new tab and when you refocus the previous tab, it reloads to an ad.

Or so I have been told.

show 1 reply
_ink_today at 6:49 AM

A browser feature I wasn't aware of for too long: long press the back button, to get a list of recent URLs, allowing you to skip anything trying to hijack the back button.

show 3 replies
blacksoiltoday at 12:30 PM

Yes please! It's very annoying how clicking an FB or Insta result from a Google search result would disallow going back to the search result!

jbonatakistoday at 12:15 PM

> We believe that the user experience comes first

Bold coming from the company who gives me the most confusing “Open in app” prompts that are designed to confuse you and get you to use their app rather than the web

https://mjtsai.com/blog/2024/03/29/those-obnoxious-sign-in-w...

CableNinjatoday at 3:13 AM

Frustrating it took this long for something to be done about this, but glad its now got something being done.

show 1 reply
parastitoday at 7:29 AM

I understand this is vague on purpose but wish there was more detail. E.g., if I am running a game in a webgl canvas and "back button" has meaning within the game UI which I implement via history states, is my page now going to be demoted? This article doesn't answer that at all.

show 2 replies
ffsm8today at 6:12 AM

I would like to mention that Google own SPA framework, angular, has redirect routes which effectively do back button hijacking if used, because they add the url you're redirecting from to the history.

https://angular.dev/guide/routing/redirecting-routes

mlmonkeytoday at 4:39 AM

But the question is: why are sites allowed to hijack the Back Button?!?

show 2 replies
cientificotoday at 12:29 PM

Click on any Youtube video from any web in android. If you press anything that is not the back button immediately, you will loose the option to go back.

So this coming from google... it's funny. Welcome, but funny.

XCSmetoday at 12:06 PM

Thank you!

One of the worst is TikTok, even as a developer, when someone sends me a TikTok link and I have to visit it, I get stuck in the browser (same with the app but I uninstalled it), and it feels almost device-breaking the way they trap you in.

show 1 reply
jonahs197today at 1:28 PM

Microsoft joke support forum stil does this?

hysantoday at 5:24 AM

Took long enough. Maybe I missed it, but I didn’t see them say how invested they are in tackling this. Promoting a rule is one thing, but everything SEO related becomes a cat and mouse game. I don’t have high confidence that this will work.

show 1 reply
gadderstoday at 11:40 AM

I hope this applies to Android as well. Reddit is a particularly egregious offender.

phkahlertoday at 1:23 PM

I never understood why browsers ever allowed this in the first place. It's obviously bad. Yeah, yeah there are "reasons" but it's still obviously a bad solution to whatever "problem" they were trying to solve.

kristopoloustoday at 6:21 AM

Almost 30 years ago I wrote an article advocating for domain level back button with a quasi mode like ctrl to traverse domains.

Would have fixed this. Too late now

gwbas1ctoday at 1:29 PM

It seems like a lot of the APIs that make a website act like an application need to be disabled by default; and some kind of friction needs to exist to enable them.

Edit: I'm not sure what kind of friction is needed, either an expensive review process (that most application developers would complain about but everyone else would roll their eyes) or a reputation system. Maybe someone else can think of a better approach than me?

oliwarnertoday at 5:55 AM

Now do the Amazon app.

Number of times I've looked for something on my phone, gone through to a product page on Amazon but then have had to back out multiple times to get back to the search listing. Sometimes it's previously viewed products, sometimes it's "just" the Amazon home page. It should be one-and-done.

eBay too. I'm sure there are others.

the_gipsytoday at 7:42 AM

> We believe that the user experience comes first.

Excuse me??

evikstoday at 9:42 AM

> Why are we taking action? We believe that the user experience comes first.

What's the real reason?

show 1 reply
sidewndr46today at 12:36 PM

too little, too late. The API for interacting with the back button in Javascript should never have existed in any capacity.

vsgherzitoday at 7:00 AM

Amazing change, fighting with the back button is my least favorite part of the ad web and a blindspot for ublock. I wonder how Google is going to track this and if SPA style react router sites would be downranked because of the custom back button behavior. I doubt it due to their popularity but I'm curious how they're going to determine what qualifies as spam

Aardwolftoday at 8:25 AM

Why not fix this at the browser level? E.g. long or double click on back button = go to previous non-javascript-affected page (I mean by that: last page navigated to in the classical sense, ignoring dynamic histories altered by js and dynamic content)

show 2 replies
a13otoday at 11:17 AM

This would have been great back when I used a search engine to visit web pages.

seanalltogethertoday at 10:12 AM

Does this also apply to sites like instagram that simply erase your entire back button history if you visit the site.

neeeeeealtoday at 11:56 AM

Is there not a plugin that helps to fix this?

Yizahitoday at 10:01 AM

I'm at a stage when I click back button extremely rarely and is amazed when it works as I expected.

skrebbeltoday at 11:42 AM

How does this work? How can a site inject a totally different site into the history? I thought eg the History API only lets you add to the stack and pop, not modify history?

show 1 reply
chakintoshtoday at 8:27 AM

Google should probably talk to Microsoft about this because for me they are the biggest offenders with this back button hijacking in their support forums.

LLLDPtoday at 8:44 AM

So someone developed a malicious plugin to achieve this? Otherwise, I can't imagine how they could bypass the browser to do this.

felixdingtoday at 11:16 AM

This is great. Can Google also stop scroll hijacking?

mikkomtoday at 7:50 AM

Maybe we can get facebook finally drop this dark pattern

monegatortoday at 5:49 AM

Phew. for a moment there i thought they would start blocking alternate uses of the back button in apps (for like when it means "go back" and when it means "close everything")

That would have severely rustled my jimmies

psidiumtoday at 5:26 AM

Ironically, we have an infringing website right now on the front-page of HN (nypost).

twismtoday at 4:27 AM

Reddit! I'm looking at you?

show 3 replies

🔗 View 22 more comments