Re:A Minimum Viable Computer, or Linux for $15
by wanderingjew on Wednesday January 26, 2022 @12:25PM
(#30088494)
yeah I asked jwz how to do that, but I can't figure out a way to make that work with Github pages.
[ Parent
| on HN ]
Re:A Minimum Viable Computer, or Linux for $15
by Beltalowda on Wednesday January 26, 2022 @12:29PM
(#30088573)
if (document.referrer === 'https://news.ycombinator.com/')
window.location = 'https://cdn.jwz.org/images/2016/hn.png'
Or something along those lines should work.
Re:A Minimum Viable Computer, or Linux for $15
by demindiro on Wednesday January 26, 2022 @01:16PM
(#30089382)
He checks the Referer header[1]. In Firefox you can prevent that header from being sent by setting `network.http.sendRefererHeader` to 0 (in about:config).
[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Re...
Re:A Minimum Viable Computer, or Linux for $15
by shakna on Wednesday January 26, 2022 @12:30PM
(#30088598)
HN helpfully uses the referrer, so you can easily do it with a tiny bit of JS:
<script>
if(document.referrer == "https://news.ycombinator.com/") {
// Mess with HN users here...
}
</script>
Re:A Minimum Viable Computer, or Linux for $15
by vidarh on Wednesday January 26, 2022 @01:20PM
(#30089468)
View source on the linked website just now:
<!-- DO HN STUFF HERE
<script>
if(document.referrer == "https://news.ycombinator.com/") {
window.location = 'https://bbenchoff.github.io/images/Brogrammers.png'
}
</script>
-->
Re:A Minimum Viable Computer, or Linux for $15
by bryanlarsen on Wednesday January 26, 2022 @12:34PM
(#30088647)
JWZ appears to use Apache, so he probably does something like http://www.htaccess-guide.com/deny-visitors-by-referrer/
Re:A Minimum Viable Computer, or Linux for $15
by numpad0 on Wednesday January 26, 2022 @02:04PM
(#30090176)
That is the way it was done back in the day, usually when admin wanted guests to not come through Google Search or to come through a correct word-of-mouth bouncer page. Client side JS implementations allow content to be viewed by blocking JS.