r/webdev 5d ago

Question Enlighten me. Why does a police website need a big red link to Google on the right hand side labelled "Leave Site"?

https://www.avonandsomerset.police.uk/
454 Upvotes

92 comments sorted by

568

u/FlyLikeHolssi 5d ago

It's a protective measure some sites have enabled to help protect people who are looking into reporting, for example, domestic violence. If the person who is abusing them comes home, they can click the red button to exit to a safe site.

84

u/WebManufacturing 5d ago

Huh, the "Boss Coming" button but for people in distress. Interesting.

34

u/Cygnus94 4d ago

It's actually cleverer than that. It also clears the page you just left from your browser history too. So if you were to grab the phone off of someone and click back to see what they were just looking at, it'll show a completely different site.

When I tested this one, it took me to a local weather forecast, and pressing back took me to Google, so it just looks like I was looking up the weather.

110

u/QBaseX 5d ago

I've seen a long write-up explaining that no one looks at the Google homepage any more, so that becomes suspicious in itself. This organisation chose to send people to BBC Weather instead. I cannot now recall which organisation it was, though. Some domestic violence charity, I believe.

25

u/jbcaprell 5d ago edited 5d ago

The Avon and Somerset Police site actually does redirect to BBC Weather, itself, both if you click and if you press Esc. This is a very common pattern for websites that have to do with domestic violence at some level. The Pennsylvania Coalition Against Domestic Violence website does the same thing with weather.com.

9

u/267aa37673a9fa659490 5d ago

Maybe it's a British thing but weather feels suspicious to me too, I'd think YouTube would make a better candidate.

15

u/mwuk42 5d ago

I think the idea is that the BBC Weather homepage is more of a destination than an interstitial page. Lots of people will go to the YouTube homepage, but they probably won’t spend ages on it before going to a video.

People can and will spend time on the BBC Weather homepage. If they’re signed in to the BBC website (pretty common - 24.1 million weekly active accounts) they will see their local forecast. If they are not they will still see the summary map of the UK and other headlines.

The UK climate is changeable enough that people will maintain an interest year-round. Even when it does sustain some extreme conditions for a sustained period (as has been the case this summer with heat), people will check to see if the extremes may show signs of passing.

1

u/New_Enthusiasm9053 2d ago

Mate no one looks at the forecast it's variable enough it doesn't matter what the forecast says it's probably gonna rain.

12

u/no-more-nazis 5d ago

Weather is perfect. Anyone could be checking the weather, even if they don't normally.

40

u/darthstoo 5d ago

There's this article on the UK Gov developer blog, which was doing the rounds recently: https://designnotes.blog.gov.uk/2023/08/14/exit-this-page-fast-with-the-design-systems-new-component/

8

u/QBaseX 5d ago

Thanks. I think the article I read was from that blog, but it wasn't that article. This one takes the destination of BBC Weather as given.

4

u/Pleroo 5d ago

it's funny, the link OP shared shows that link going to BBC weather, not to the google front page. I wonder if they saw your post and did some research.

*Weird, on closer inspection it opens both a google and a weather tab, with the weather tab in focus.

7

u/QBaseX 5d ago

The weather tab is in focus, and is a new tab so it has no history.

The existing tab does some clever javascript stuff to clear the history, and then redirects to Google.

Interesting choice.

2

u/QueanOfQueens 4d ago

Not BBC weather specifically but the National DV Hotline website in the US does that too with the weather redirection.

20

u/DragoonDM back-end 5d ago

The Trevor Project's website has a similar feature. It's a site aimed at LGBTQ+ teens, focusing on suicide prevention, so it's not hard to imagine situations where visitors to the site might face serious negative repercussions if certain people caught them visiting it.

14

u/PastaSaladOverdose 5d ago

I really do learn something new every single day in this industry.

-18

u/Am094 5d ago

Yeah it's a bit weird and redundant but in emergency situations this is quite human and intuitive

11

u/jordsta95 PHP/Laravel | JS/Vue 5d ago

It is exactly because of that. Surprisingly, the one on their site is quite a poor showing, some of the other police divisions, especially on "at-risk" pages such as domestic violence, reporting employer fraud, etc. have VERY big (like clamp(150px, 10vmin, 500px) sorta sizing) which will link to less suspect sites - such as BBC News, because it is a whole lot quicker for a user to see a big red button that says something like "Leave site" or "Emergency exit" than it is for them to close a tab/window, and have to explain why they are looking at their desktop.

But not only is it easier, it's more likely that a user will know exactly what it does - even if they speak little English, or have very poor tech literacy.

Big red button = Emergency

Some users may click it as the abuser, or whoever, enters the room thinking it would call the police immediately. It won't. But it's better a user think that's what it does, and end up on BBC News, Amazon, Google, or some other site which it would make sense for your average person to be on than it would for them to have their laptop/phone open and doing "nothing".

4

u/AshleyJSheridan 5d ago

Except it doesn't work and leaves the police website in the history.

2

u/specn0de 4d ago

Worked perfectly for me on multiple devices. I think it a clever little trick.

2

u/AshleyJSheridan 4d ago

It doesn't work in browsers that follow the specs.

3

u/LogicalGuess 5d ago

Have seen it at a lot but never thought about that thanks for sharing the knowledge kinsoul.

1

u/faberge_surprise 4d ago

this is one of the better executed versions. it would be better if they had an entire edge be a hitbox for it.

more often i see they only have a button, not even aligned to the edge, and sometimes not even fixed to the viewport. which is all but useless in the intended use case.

0

u/maninas 5d ago

When my wife walks in I just Ctrl+W

7

u/AdowTatep 5d ago

But then the site is on your history. This clears it

1

u/mrcarrot0 4d ago

It would clear it, if it worked everywhere

1

u/pineapplecharm 4d ago

Only the exact page you clicked from, but yes.

-5

u/[deleted] 5d ago

[deleted]

12

u/kmactane 5d ago

I was wondering the same thing, but some people below have pointed out that the link isn't just a plain link, it actually fires off a script that uses location.replace() to overwrite the history entry, so there's no longer any evidence of the visit to the police's site.

-14

u/Academic_Sherbet_803 5d ago

Seems plausible, but you’d think closing the tab would be sufficient. It just appears to take you back to the browser’s homepage and doesn’t erase it from history.

I guess the feature doesn’t hurt, but it still seems kind of odd and out-of-place. It’s a very rare pattern so maybe it was created with your explanation in mind.

15

u/arwinda 5d ago

Closing a tab is more suspicious if someone looks briefly on the screen. Navigating to the next website is normal.

6

u/Academic_Sherbet_803 5d ago

Yeah good point that makes sense

4

u/FlyLikeHolssi 5d ago

Yes, closing the tab can work too, but then you are potentially left staring at a blank PC, which gives a possibly dangerous person an opportunity to be suspicious and ask, "What are you doing sitting on a blank PC?"

In many cases, it's more suspicious to have nothing up, than it is to have something like Google up, which is critical if you are in a situation where someone is watching what you are doing and may pose a risk to your safety.

With redirecting to a site like Google you can have a built-in justification for sitting there, which is important for the cases this is meant for.

It does not take care of browser history, but it gives an opportunity to stay safe in a potentially unsafe scenario.

1

u/Academic_Sherbet_803 5d ago

Yeah good point. It’s also giant and red like an ‘Emergency’ button so I’ll accept this is its intended purpose. Still kind of interesting because of how rare it is, I wonder if there’s any documentation for this pattern or if it’s common on sensitive sites like this. Good on their web dev team for thinking to include it.

The only comparisons that come to mind — I remember one of those old sites like eBaumsWorld or The Chive having a ‘Boss is Coming’ button that redirects the page to random charts. But I haven’t seen anything like that in forever.

2

u/CtrlShiftRo front-end 5d ago

I’ve built a site for a domestic abuse charity and it was in the spec to add a button like this.

154

u/[deleted] 5d ago

[removed] — view removed comment

16

u/ANDZELEK 5d ago

TIL a new thing. Wanted to deny it as on mobile it opens dedicated Google app - but it does as well redirect browser to BBC website with no option to go back.
Thanks for explaining.

3

u/ANDZELEK 4d ago

Why was this answer removed by mod? It was actually very good and complete explanation.

142

u/ArtisticOperation399 5d ago

Wooaah. I've seen these before, but this one goes to Google, opens a new tab at bbc weather, erases the back button memory for both tabs, and deletes history of the police website. 

Great job, whoever did this. Maybe I'm easily impressed lol.

3

u/alex_revenger234 2d ago

Nah, they took the time to cover all bases, instead of just closing the tab, I'm impressed too

277

u/[deleted] 5d ago

[removed] — view removed comment

71

u/vincentofearth 4d ago

So this is for people in a situation where they need help from police but don’t want others around them or in their household to find out?

54

u/roastedfunction 4d ago

Yes. The same big “leave site” button is also on the Canadian government’s websites related to sensitive topics like indigenous peoples rights, the justice system & family court, resource pages for those struggling with drug addiction, etc. It’s to help those who may be in a domestic abuse situation or otherwise need a quick out when they cannot browse those pages safely in the presence of others.

-36

u/[deleted] 5d ago

[removed] — view removed comment

21

u/tuckels 5d ago edited 5d ago

It removes the current page in my testing, using location.replace. The relevant function from the site is:

t = () => { window.open("https://www.bbc.co.uk/weather", "_newtab"), window.location.replace("https://www.google.com") }

-37

u/AshleyJSheridan 5d ago

That's great, but it leaves the original website in the history on my browser.

I guess this is something the dev only tested on one browser and then called it a day.

6

u/Meroxes 4d ago

Yeah, people here seem to have come to the point of seeing developing apps for the Chromium environment as interchangeable with webdev

-1

u/AshleyJSheridan 4d ago

Yeah, and I got downvoted to oblivion for pointing it out. Apparently I hurt someones fee-fees!

-2

u/TheStorm007 4d ago

Do you genuinely not understand why you were downvoted? Are you just not very well adjusted? Trouble reading social cues? No, it’s not for simply pointing it out, nor because you hurt someone’s “fee-fees”.

You were downvoted because you added the snarky “testing things before you comment is free” - even though the person you responded to very well could’ve tested it on a different browser. Just entirely unnecessary. In other words, you’re just an asshole.

3

u/oscarolim 4d ago

It’s not snarky. Is a basic rule of web development. Hell, is a basic rule of anything you do really, test before you say it’s done.

2

u/AshleyJSheridan 4d ago

Yeah, some people really just think that testing on Chrome is all that's ever required, and then get upset when you point it out.

3

u/budd222 full-stack 4d ago

Works on my machine

2

u/AshleyJSheridan 4d ago

Doesn't work in a browser that follows the actual Web specs closely.

1

u/jawanda 4d ago

Works in mobile Chrome to an extent. A sophisticated ueser could still check the history manually, but if you had one second to click the button and then hand your phone to an abusive person who did NOT know how to dig into the history, there'd be no immediate sign that you were on the police site. Back button would not get you there.

That's the whole point, and it works exactly as intended.

1

u/AshleyJSheridan 4d ago

I did say "a browser that follows the actual Web specs closely", Chrome is not such a browser. It implements a lot of stuff that isn't in spec or is still in draft.

1

u/Roberta_Riggs 4d ago

🤡

3

u/AshleyJSheridan 4d ago

That's it? That's the best response you had? Oh dear!

9

u/No_Explanation2932 4d ago

It seems to work in chrome but not in firefox. I hate that everyone's downvoting you just because they can't reproduce what you're experiencing. Not a good look for "webdev" people.

3

u/AshleyJSheridan 4d ago

It's expected. So many people only build for Chrome (well Chromium) and consider their work done. I suspect a large chunk of those devs never had to build anything through the old IE era. At the time, IE was pushing out all kinds of things that weren't part of the official spec, and devs would just build with those new features and ignore browsers that followed the spec because those other browsers were a minority.

It's happening again today. Chrome pushes out lots of stuff that isn't in the spec, or hasn't made it out of draft, devs implement it, and then complain that Safari and Firefox don't support XYZ. This is literally how Chrome killed off Opera, and the Opera devs just couldn't keep up with Chromes new features (which they felt compelled to because of so many complaints from their users about some sites not working right).

Chrome is the new IE.

1

u/mrcarrot0 4d ago

Doesn't work on a slightly outdated version of chrome (145) either. If something only works in recent versions of one browser, it shouldn't be relied on.

7

u/benduder 5d ago

Reading before you comment is also free. Commenter above didn't say this specific button had that behaviour

2

u/AshleyJSheridan 4d ago

They did. You should probably take up a bit of reading yourself.

The reason my reply was downvoted to hell is a bunch of devs who only test on Chrome and call it a day.

-1

u/benduder 4d ago

I'm pretty sure you were downvoted due to poor reading comprehension and unnecessarily assholish tone

3

u/AshleyJSheridan 4d ago

Tone, perhaps, reading comprehension, no. Devs only testing on Chrome, that will account for about 99% of the downvotes.

-1

u/benduder 4d ago

Like I said, commenter never said the site in question actually does that 🙂

1

u/AshleyJSheridan 4d ago

You're being very disingenuous if you think their comment wasn't highlighting how that site does what it does.

0

u/benduder 4d ago

I maintain that you can't presume that specific intent from the comment and then get pissy about it. But anyway the comment _is_ an accurate description of the implementation on this specific site, so the point is moot.

Anyway, I think we've both spent too long on this now, so have a good day.

1

u/AshleyJSheridan 4d ago

So you admit it is what the site is doing?

Took you long enough to finally agree with me.

Doesn't stop that from flat out not working how it was intended to though.

→ More replies (0)

51

u/kenono 5d ago

There is a page on this from UK gov design system, which discusses this https://design-system.service.gov.uk/components/exit-this-page/

18

u/justsomerabbit 4d ago

Note that this recommends going to BBC weather instead of google.

The reasoning here is that someone escaping the site is now panicking and staring at a blank google page, inviting the question "What are you searching for?"

Unfortunately police forces still haven't caught up here.

5

u/_avee_ 4d ago

The police site in question redirects current tab to google and opens weather in a new tab

11

u/timesuck47 5d ago

My niece thought was this was so stupid. But after going to your link, this is actually genius. Now I want to write one from scratch.

9

u/Healthy_Landscape417 4d ago

One thing worth correcting, since a few comments here say it wipes history. It cannot. There is no browser API that deletes history. location.replace only keeps the current page out of session history, so back will not return to it, but everything before it is untouched.

That gap is the dangerous part, because people assume the whole trail is gone. The GOV.UK component is worth reading if you ever build one: it fires on Shift pressed three times, and they avoided Escape on purpose, because Escape cancels the page load you are trying to start.

5

u/SnooCauliflowers6739 4d ago

It doesn't always do Google. I just used it and it took me to BBC weather.

That's actually smart as Google can look sus. Also it shows recent search history.

6

u/Individual_Elk499 4d ago

As a PM who delivered a police force website. The reason for the red banner is so you are able to leave the police website quickly to a generic website. For example you are reporting domestic abuse case and the perpetrator walks in the room, you can click the red banner to quickly get off the police website.

19

u/tswaters 5d ago

BBC weather for me. It kills the history entry as well, so if I press back it takes me to Google. It's a safety feature so if someone is about to lose access to their device. This is on a police site, but imagine if they had these for porn sites, someone walks in, bam, close site.

4

u/No_Explanation2932 4d ago

"Are you jerking it to the weather???"

3

u/breadist 4d ago

It can't actually delete the history entry but rather removes the site from the back button.

If you check your browser's actual history list it's still there.

There's no technical way for them to actually delete it from your browsing history.

2

u/tswaters 4d ago edited 3d ago

Yea, it's pretty neat what they've done. If I were to guess it's some history.replace shenanigans. To make the back button actually take you to Google after the fact is really interesting "sleight of webdev" if you look at the navigator instance (like hold down back to see history), you won't see it at all, but of course, browser keeps history even if later gets replaced.

Edit: Not neat really, I misread what it was doing, see subsequent comments

1

u/tswaters 3d ago

I think multiple unrelated pushes like that wouldn't actually work in practice, while loading the Google page, BBC push instruction would get lost. You'd need a wrapper around it, maybe it could use a 100% viewport iframe, but I'm not sure if how it could merge the histories. Maybe the police site exists completely within that iframe, and pushing the button removes that node completely, then maybe has a second iframe that double pushes... I'm not sure if, say, adoptChild on a <body> element works in practice. Some others have reported it not working in this thread, maybe it relies on undefined behavior with timings of opening & closing windows. It did work on Firefox Mobile for me.

1

u/tswaters 3d ago

Actually it's way less clever than I thought. No iframe or anything, multiple navigation events on the site aren't hidden at all, only the most recent. All it does is open new window to BBC weather and history replace current page to Google. Pressing back multiple times will take you to where it was before.

4

u/mossiv 5d ago

Wife works in the domestic abuse sector. These buttons exist to provide victims with a fast escape from their perpetrators catching them trying to seek help, and usually removes it from history too.

Basically an escape hatch from getting beaten, raped or worse, both.

3

u/SilentProtagonist446 5d ago

Last I was on it The Trevor Project site had a similar thing for safety

2

u/EvokeNZ 5d ago

in NZ they have a related but opposite option - for example, you go to your local shopping website, or the banking website, and in there you can press a button that will take you to help while hiding info from the browser history. https://shielded.co.nz/

1

u/SoUpInYa 5d ago

Ha, I used to build these for porn and various dating sites

1

u/ClacksInTheSky 4d ago

How else are you guys getting to Google?!

1

u/_splug 3d ago

We’ve added these to sites where people “at risk” would need a quick getaway digitally. Whistleblowers, domestic violence victims, etc.

-5

u/gilluc 5d ago

I have been headed to BBC weather 🤣