News for hackers. Stuff that matters.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by jt2190 on Monday March 31, 2014 @12:06PM (#7502303)
Very cute. :-)

Now that we've all had a laugh, wouldn't it make more sense to have the server respond with a redirect to a shared copy of the script hosted somewhere that provides bandwidth for free? (Perhaps this is a sign that the script should be open-sourced as well.)

Re:Evil.js: A JavaScript library for thwarting hot-linkers by orthecreedence on Monday March 31, 2014 @01:22PM (#7502828)
If someone hotlinked one of my scripts, I'd update the head of the script and use the opportunity for free marketing:

    if(!window.location.host.match(/(www\.)?myapp.com/)) window.location = 'http://www.myapp.com';
I bet they won't hotlink after that.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by danielweber on Monday March 31, 2014 @02:38PM (#7503286)
I know someone who had, of all people, Facebook hot-linking to his stuff. He redirected all visitors to his homepage. Then Facebook's legal department called his home number, his wife answered and got nervous, and it all ended there.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by orthecreedence on Monday March 31, 2014 @03:03PM (#7503426)
Interesting! I personally would have loved to have a chat with Facebook's legal team about the issue. Although I'm a bit surprised they'd actually call him instead of either a) not hotlinking anymore (seems to be the most obvious solution) or b) just sending a quick C&D.

I'd be surprised if they actually have a leg to stand on legally if they are hotlinking off someone's site, especially if there's have no prior agreement to allow them to do so.

Re:Evil.js: A JavaScript library for thwarting hot-linkers by foobarian on Monday March 31, 2014 @10:46PM (#7505858)
Sounds fishy. It would take days for any kind of legal action like this. Doesn't FB push code like every couple of hours? A code patch would have been many times quicker.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by jt2190 on Monday March 31, 2014 @02:01PM (#7503072)
I like this. I'd think it'd be even better if instead of getting them to stop linking, you could turn them into a permanent source of referrals.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by orthecreedence on Monday March 31, 2014 @03:04PM (#7503434)
If you added a `Math.random() < .01` in the if clause, I doubt they'd ever even notice, and depending on how much traffic they get you could have a nice steady flow of referrals =].
Re:Evil.js: A JavaScript library for thwarting hot-linkers by tibbon on Monday March 31, 2014 @12:20PM (#7502375)
But bandwidth isn't free. Someone's gotta pay for it in some way or another, and if a major company lets say is using your hosted copy without asking, then perhaps they should host their own?
Re:Evil.js: A JavaScript library for thwarting hot-linkers by ithkuil on Monday March 31, 2014 @12:36PM (#7502484)
there are cdns happy to host useful opensource scripts for free, assuming you want to release your script as open source.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by arcatek on Monday March 31, 2014 @12:20PM (#7502378)
This script is used by rawgithub.io. It allows to punish the 'abusers'. There isn't really a notion of open-source in it.

I think the idea is more that if someone is eating your bandwidth by hotlinking your jQuery.js, then you can serve them this instead.