1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Sell Javascript?

Discussion in 'HTML & JavaScript' started by Sampler, Aug 8, 2012.

  1. Sampler

    Sampler Senior Member

    Joined:
    Nov 1, 2010
    Messages:
    994
    Likes Received:
    878
    Ok, this is not meant to be a presales thread or anything but this is what I wanted to know.

    I've got some code which executes something which I know will be extremely popular to many people.

    Because essentially it's a piece of code which anyone could then easily resell, in what way do I go around protecting this code should I wish to sell it?

    Can I turn it into a piece of software or do I have to host it on a server and potentially charge people per each request they send (that's assuming I can get it to execute the code from a server anyway)?

    Personally I've got the code saved as an address in a bookmark tab and just hit it every time i want it to run but want to know the best way I could sell/distribute it to others without them seeing the code themselves.

    Thoughts?
     
  2. Junkfood00

    Junkfood00 Elite Member

    Joined:
    Sep 13, 2011
    Messages:
    1,949
    Likes Received:
    1,336
    :confused:

    JavaScript is a client-side scripting language so you cannot protect it from the public view. What you can do is offer support and updates for a fee.
     
    • Thanks Thanks x 1
  3. Sampler

    Sampler Senior Member

    Joined:
    Nov 1, 2010
    Messages:
    994
    Likes Received:
    878
    Hmm, thanks. Perhaps I'll just have to hire someone to write the code in another language. Hopefully it's not too hard to convert JS/the principles my script to another language.

    Thanks for the heads up though.

    Sampler
     
  4. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    Depends on what the code does. If it's ajax or modifies the users experience without reloading you're stuck with javascript. Maybe portions of it can be offloaded to the server side but it depends on what it does exactly.
     
    • Thanks Thanks x 1
  5. Sampler

    Sampler Senior Member

    Joined:
    Nov 1, 2010
    Messages:
    994
    Likes Received:
    878
    No, it's got nothing to do with user experience. As an example of what it does I'll say "on a youtube page it will automatically make my account report all the comments as spam" **PLEASE NOTE THIS IS AN EXAMPLE and NOT what I do.

    The problem is I would have to somehow make the program/server go to their youtube account which they are already logged into and do it there i.e. I can imagine users won't want to add their youtube username and password (or maybe they will).

    But yeah, would you recommend any other language to try and convert this to?
     
  6. spmazon

    spmazon Junior Member

    Joined:
    Jan 21, 2012
    Messages:
    106
    Likes Received:
    38
    Home Page:
    You can obfuscate it. It will make hard to understand it.
     
  7. Sampler

    Sampler Senior Member

    Joined:
    Nov 1, 2010
    Messages:
    994
    Likes Received:
    878
    Thanks, that won't help restricting the unauthorized distribution of the code though.
     
  8. spmazon

    spmazon Junior Member

    Joined:
    Jan 21, 2012
    Messages:
    106
    Likes Received:
    38
    Home Page:
    Is it possible to move your code to webservice, So client can access your service by ajax.

    Or write web browser plug in. I see some company have web browser plugin product.
     
  9. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    Again, without knowing exactly what it does its hard to say for sure. I can tell you that browser security restricts a website from modifying or accessing another, or its cookies. You would probably be better off making it a SaaS in PHP. They would have to enter their info but it protects your code.
     
  10. closedCaption

    closedCaption Regular Member

    Joined:
    Oct 3, 2011
    Messages:
    289
    Likes Received:
    111
    Maybe I am missing something, but couldn't you use http://nodejs.org/ to hide your code and build web site in front of it?

     
  11. devnull

    devnull Registered Member

    Joined:
    Aug 25, 2010
    Messages:
    55
    Likes Received:
    8
    His example makes it sound like it needs to be run in the context of a browser. If it doesn't require DOM, then sure, you could use Node.js
     
  12. hassan_isabad_subar

    hassan_isabad_subar Jr. VIP Jr. VIP

    Joined:
    May 23, 2012
    Messages:
    260
    Likes Received:
    70
    Occupation:
    BHProxies Staff
    Home Page:
    I have a way of running js through a program. If interested pm me and I'll give you a look in team viewer to see if it works as intended or not. If it does I'll write a program around it.
     
  13. Sampler

    Sampler Senior Member

    Joined:
    Nov 1, 2010
    Messages:
    994
    Likes Received:
    878
    Yeah, I'll maybe try and find someone who can convert it to php. I mean it's relatively simply in theory i.e. 3 lines of JS which with absolute basic knowledge of programming can somewhat understand.

    Thanks, I'll try that. Seen that site before but never really looked into it. Cheers
     
  14. lanbo

    lanbo Jr. VIP Jr. VIP Premium Member

    Joined:
    Aug 23, 2009
    Messages:
    3,430
    Likes Received:
    594
    Home Page:
    I have the solution for you - I'll PM it to you
     
    • Thanks Thanks x 1
  15. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    If you want, send it to me and I'll be able to tell you if its a javascript only type of thing, or if it can be done in php convert it for you.
     
  16. Blackberry_11

    Blackberry_11 Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    266
    Likes Received:
    19
    If you can build any software with javascript then you obviously can do this. You have to find client who need your service.
     
  17. blackhacik

    blackhacik Junior Member

    Joined:
    Nov 25, 2010
    Messages:
    108
    Likes Received:
    8
    Home Page:
    obfuscate big javascript code is good for protect source. Of cource it is only client side but is safety than without obfuscate.
     
  18. carnage_100101

    carnage_100101 BANNED BANNED

    Joined:
    Feb 17, 2011
    Messages:
    240
    Likes Received:
    163
    If this were a crazy facebo*k / social network script that uses an exploit,You would have NP selling it for a high amount or you would use it yourself and make a killing.
    Im going to assume the above does not apply because if this script had real value,Im not sure you would sell it,So my solution is to simply share it :D
     
  19. DocturBluehill

    DocturBluehill Newbie

    Joined:
    Sep 28, 2012
    Messages:
    15
    Likes Received:
    6
    I think you should make it free for personal use, and charge a license fee if it is commercial
    related. Then make a donate button on your page or show some ads. If people really like
    your script, they will also donate. I have seen this successfully implemented alot of places.
     
  20. CodingAndStuff

    CodingAndStuff Regular Member

    Joined:
    May 6, 2012
    Messages:
    236
    Likes Received:
    84
    Occupation:
    Swagstronaut
    Location:
    You can't have my bots. Sorry :'(
    Wrap it in an executable and eval it on the page if you're concerned about people stealing your code. Don't use C# or any other .NET stuff since it can be decompiled easily, making your efforts to protect it completely useless.

    You can use WebKit (or QWebKit with QT - http://qt-project.org/doc/qt-4.8/qtwebkit.html ) to achieve this easily, however there may be licensing issues you will run across. If the process can be emulated with raw HTTP requests, you could always use libcurl to get it done.