Heh, that’s something that many plugin authors do without needing help, isn’t it? 🙂 Here’s the rub — I’m coding a jQuery plugin which I have the intent to sell. I want to provide a live demo of it; of course, I don’t want anyone just using the demo code.
I know it’s dumb, and it certainly doesn’t bring any good karma, but what are some naughty things I can do in the demo script that would make life reasonably difficult for anyone trying to use it? Setting undefined = true comes to mind, as well as overriding jQuery methods. Any suggestions beyond that?
Don’t make your deno code a jQuery plugin: instead, make it a plugin for a library that is functionally equivalent to jQuery.
Basically, take a copy of jQuery and rename all of the functions in it (and/or swap around the order of function arguments). Then make a demo copy of your plugin that is modified to use the new, messed-up copy of jQuery.
Alternatively (or additionally), minify it and have it torch/delete/ruin any component of jQuery that it doesn’t need. Anyone who wants to use your minfied code will find their jQuery object has been substantially altered.
There are fairly simple workarounds to all of these defenses, but it might keep away anyone not sufficiently dedicated to understanding what’s going wrong. In the end, you may find it’s simply not worth the effort and just trust that honest customers will make development worth your while.