4 ms·
Just add this to your JavaScript onload (and replace "yourdomain", of course): if(window.location.origin.indexOf("yourdomain.com")<0){ window.locatio
by charliepark 14y ago
Just add this to your JavaScript onload (and replace "yourdomain", of course):
if(window.location.origin.indexOf("yourdomain.com")<0){
window.location.href = "http://yourdomain.com";
};
- Mahn 14y ago...unless they copied the JS files instead of linking to them directly, of course. Note to self: add remote self-destruct function within any JS I ship.
- benmanns 14y agoSecond note: Make it time delayed (set statically to something like 2 weeks from compile time). Then, when they use the script in development it works, but in 1-2 weeks it breaks in their production site. Otherwise, they will just find out why it isn't working and remove the self-destruct function.
- kls 14y agoThe question would be if they just grabbed a static snapshot of the site and are using that or if they are actually still pointing back to some of the stolen sites files. If they are pointing back to the stolen sites JavaScript files then yes it would be very easy to redirect the traffic back to their site. Given that the code resides on their server they are completely within their rights to do so as well. I would also minify the JavaScript file as well, so the change is not immediately apparent to them. Make them work to figure out why the code they have stolen is not working.
- jacobr 14y agoYou just linked to a domain registrar, please use example.com in examples.
- Mahn 14y agoI'm having a hard time trying to picture people on HN reading the comment and thinking "cool! yourdomain.com! I wonder what's in there!"
- johnx123-up 14y agoI think, better approach would be to change your HTML files and link them to newer version of JavaScript files. But, in old JavaScript add a virus code that blanks the page or do some kind of notice