0

Possible Duplicate:
How to prevent your JavaScript code from being stolen, copied, and viewed?

I'm aware its almost impossible to do something like that because JS is client side. However I'm sure some counter measures can be taken to prevent less experienced users from viewing the code. (something more effective than disabling right clicking)

I know there are measures that can be taken like this app . If you try viewing the script it blocks you somehow. How can I set up a block like this (or perhaps better) for myself?

I just want to prevent leechers :\

Community
  • 1
  • 1
Zeeno
  • 2,671
  • 9
  • 37
  • 60
  • I have absolutely no problem seeing the Javascript on that link! (In Chrome at least.) – Tim Rogers Aug 19 '11 at 08:50
  • 1
    Forget it. There are ways, but they are all flawed. Minify the script and be done with it – Pekka Aug 19 '11 at 08:51
  • I can see the JavaScript for that page just fine - Do you mean the "script" for the flash object? – Justin Aug 19 '11 at 08:51
  • @Justin, i meant this script http://www.ngads.com/checkabp.js?thisistotrickabp=http://server.cpmstar.com/view.aspx . if you search the source page, you'll find the position where that script is – Zeeno Aug 19 '11 at 09:03
  • @deztructicus You are seeing the full script (it really is that short). Its purpose is to trick AdBlock Plus. Another script sets `user_is_a_leech` to true, and then this script sets this value to false. The intention is that if an add blocker is running then it won't run this script and so `user_is_a_leech` is left true allowing the page to be rendered differently. – Justin Aug 19 '11 at 09:15
  • Ahh I see thanks. I guess I'll just have to obfuscate it then... – Zeeno Aug 19 '11 at 09:30

1 Answers1

0

The best you can do is compress and obfuscate your Javascript using YUICompressor or similar. This will at least make it hard to read.

Tim Rogers
  • 21,297
  • 6
  • 52
  • 68