logoalt Hacker News

debugniktoday at 5:48 AM4 repliesview on HN

This site redirects to HN when it notices HN in the referrer.


Replies

trashbtoday at 9:39 AM

This is an interesting way to prevent the hug of death. I wonder what the author's reasoning is, also would it really be effective?

show 1 reply
st_goliathtoday at 8:17 AM

If you have JavaScript enabled, that is. JWZ at least does the redirect on the server side.

The following is pulled in from `https://soc.me/assets/js/turnBack.js`:

    const undesirables = [
      "news.ycombinator.com/",
      // "reddit.com/", // disable temporaily
      "lobste.rs/"
    ] ;

    if (undesirables.find(site => document.referrer.includes(site))) {
      window.location.replace(document.referrer);
    }
I wonder why Reddit is "temporarily not undesirable".
show 1 reply
thereintoday at 7:44 AM

Wow, I didn't even notice because I have extensions that strip the referrer header. Excellent.

chimpontheruntoday at 7:04 AM

open in new tab

show 1 reply