Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Protect Javascript?

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #185923
    TC
    Participant

    Hi everyone.

    I’m fairly new to Javascript but I’m wondering how can I protect my Javascript code from the eyes of others?

    In the future if I get good enough I want to create products made from Javascript.

    But if there’s no way to protect my hard work it doesn’t make sense to create products for sale using Javascript?

    I have found this website but I don’t know how it works:
    https://jscrambler.com/en/tour?gclid=CjwKEAjw5NihBRCZmdLkuuTHyWYSJACtCY0JdVBy2_zaRdziDEcwGrZnb2ngnClR1N1ElW072MvtPhoCN23w_wcB

    Thank you.

    #185927
    TheDoc
    Member

    Meh, pretty pointless. At the end up the day you’ll be serving up minified and compressed files that won’t be easy to replicate.

    #185932
    shaneisme
    Participant

    I’m a strong supporter of full open-sourcing, the benefits are amazing.

    That’s just my opinion.

    Even if you don’t do anything weird like scrambling up the code so it’s illegible, you can still set up the license to protect your work if you’re planning on selling it. I’m certainly not an expert on that, but I’m pretty sure you’d have to hire a lawyer for that kind of thing. Even if you use a server-side language I can’t see by viewing the source of your site you’d want to do this.

    #185933
    TC
    Participant

    Hmm.

    I’d think if the code wasn’t protected I’d get totally ripped off.

    Meh, pretty pointless. At the end up the day you’ll be serving up minified and compressed files that won’t be easy to replicate.

    I will?
    I’m new so I don’t know enough about it but right now I’m writing full Javascript and php.

    Even if you don’t do anything weird like scrambling up the code so it’s illegible, you can still set up the license to protect your work if you’re planning on selling it.

    That theory sounds good but in reality it’s not like I could sue or enforce 250,000 different people who stole my work…
    Cannot afford it and don’t see how to enforce that or even prove they stole it.
    They would only have to modify a little here and there and then it’s not provable.

    I’m a strong supporter of full open-sourcing, the benefits are amazing.
    What benefits to help me make money and make a living?

    If I sell something for $45 or $50 bucks but it’s all open source code I don’t see many people paying for it if they can easily steal it.

    Even if people don’t steal it on a larger level a company or another developer could easily create a competing product from my source and screw me out of my sales.

    If I’m handing others the source it’s like I’ll be working for nothing.
    I’m already too broke for that.

    Question:
    Do you guys support yourself by selling projects to the public ?

    Next question:
    Are you wealthy?

    :)

    #185937
    shaneisme
    Participant

    Point 1:

    For you to get 250k people to use your script is a feat in and of itself if it’s free.

    Point 2:

    That theory sounds good but in reality it’s not like I could sue or enforce 250,000 different people who stole my work…

    Yeah I know… Microsoft, Adobe, et al know too.

    Point 3:

    If I sell something for $45 or $50 bucks but it’s all open source code I don’t see many people paying for it if they can easily steal it.

    You’re absolutely correct, but nothing would stop people from donating if it’s really awesome – check out the dude that wrote AdBlock.

    Do you guys support yourself by selling projects to the public ?

    Sure, if you can get people to buy it you did something awesome. You might want to start with working directly for clients though, steady money in it if you treat people right.

    Are you wealthy?

    Depends on who you ask.

    What benefits to help me make money and make a living?

    It brings you into a community of like-minded developers that are all trying to make things better for all by sharing their knowledge. I’ve found that networking in that community has intrinsic benefits like bringing jobs your way.

    #185938
    __
    Participant

    If I’m handing others the source it’s like I’ll be working for nothing.

    Before getting into whether or not “open source”* is a good thing or not, let’s get one thing clear:

    the only possible way to “protect” your javascript (meaning, “keep control of it” and “prevent others from taking it”) is to keep it off the internet. Websites work by literally handing the source code over to whoever asks. Users run the code, not you. If they don’t have free and total access to your code, they can’t see the result. Period.

    * BTW, “open source” and “free” are completely not the same thing. And Yes, I also wholeheartedly believe in the open source software model.

    To address your questions:

    Yes, people make money programming nonetheless.

    Yes, licensing and legal avenues (which usually doesn’t have to come to actual lawsuits) are the best (meaning “most effective”) way to protect your products and IP.

    Yes, I support myself.
    No, I’m not rich …yet : )

    #185969
    Senff
    Participant

    Whether or not it’s useful/smart to hide JavaScript code, there’s no way to completely hide it in a closed system, unless it’s something like HTML/CSS/JavaScript that will be compiled into a mobile app or something.

    However for anything on the web, this is not possible. Like @TheDoc says, you should minify it anyway, and then it will be more difficult to figure out. For example, let’s take one of my own plugins.

    My original JavaScript is here: http://github.com/senff/Sticky-Anything/blob/master/jq-sticky-anything.js
    That’s pretty easy to figure out, or steal/copy and then modify, etc. But this is the source code, not that script that you should actually use.

    For that, I would recommend the minified version of the same script: http://github.com/senff/Sticky-Anything/blob/master/jq-sticky-anything.min.js
    That’s a lot more complex to understand right away. It can still be “untangled” but it’s an extra layer, in a way.

    So, I agree with the people above that it’s useless trying to figure out how to protect your code. But what’s more important is that you should trust your users a little bit more.

    That theory sounds good but in reality it’s not like I could sue or enforce 250,000 different people who stole my work…

    What golden jackpot idea do you have in mind that is so good that hundreds of thousands of people want to steal it?

    If I sell something for $45 or $50 bucks but it’s all open source code I don’t see many people paying for it if they can easily steal it.

    I disagree. People will pay, as long as it’s actually good software that’s worth the price. Trust your customers a little more. With software like this, it’s not like music or movies. The “why pay if I get it for free?” doesn’t really apply here.

    And hey, I consider being pirated an accomplishment, to be honest. I came across a site the other day where paid WordPress plugins are being offered for free. One of my own plugins was among them….and I’m actually flattered that they deemed my plugin good enough to pirate. :)

    #185980
    __
    Participant

    But this is the source code, not that script that you should actually use …I would recommend the minified version of the same script

    I complete agree, though obfuscation doesn’t make my list of reasons. Minified code simply transfers faster.

    #185984
    Senff
    Participant

    Oh, I didn’t mean that the minified code would be more safe or secure or copy protected. Definitely not one of my reasons, it’s just an added bonus if you DO want a more “cryptic” structure (such as OP).

    #185989
    __
    Participant

    no problem.
    I didn’t think you meant that; just wanted to clarify.

    #186275
    James
    Participant

    You can obfuscate code in pure Array format that looks like a bunch of hex values, though someone can just as easily undo it.

    Which brings me to the point…

    If you’re intentions are selling so sudden when you’re pretty new to front-end and back-end development, you’re definitely in the wrong era of the web. I mean, there’s nothing wrong with worrying about people replicating your work and wanting to create fantastic work, but to define it so boldly as if you’re going to be this kind of “sales” kingpin in selling javascript (which is exactly how I felt this came across), you’re looking at this wrong. I find that if people genuinely like your codebase, they will invest in it; hence, buying it.

    What you’ll find these days is that many, many javascript utilities and plugins are merely free and open-source. What you’re making right now could already be done somewhere else, completely open-source and nails the primary objective it is intended for.

    The questions you need to be asking are:

    What makes your product/plugin worthy?
    Is it cost-effective?
    Is it written worthy of selling to a client?
    Is it future-proof, sustainable and maintainable for you and anyone else who may read your code or actually use it for its intentions?

    You get the idea. Then, you need to think about licensing it. Licensing Javascript is extremely difficult. People write entire platforms open-source akin to development. Unless you’re selling it through something like CodeCanyon, maintaining your code rights will be extremely difficult, even if just one person decides he doesn’t want to pay you nor credit you for the work. This is purely because they’re using it for non-commercial purposes, and would cost you more to lawyer up than that Javascript has ever made you, ever. Although this may seem extreme, it’s the truth.

    As for your theory on people ‘stealing’ your work based on the fact it is open-source, I don’t understand you here. Do you mean as in people redistributing your work as their own or using it to their expense?

    You’re highly unlikely to run in to a developer who has turned your code over in to something better, unless you have at least some intelligence, can write Javascript of the back of your hand and then convert that in to something innovative.

    You’re looking at this from all the wrong reasons.

    In the future if I get good enough I want to create products made from Javascript.

    In the future, should you become skilled in writing javascript and/or building great products, you’ll learn about licensing along the way and how to implement it sufficiently. Until then, there is absolutely no point in worrying about it now. Learn how to become a great developer, and most of all, enjoy what you do! Don’t worry about people ‘stealing’. :P

    To answer your question simply: there is no realistic way to hide your front-end JS from the user, no matter how hard you try. Minifying it is your best shot. Don’t get the idea in your head that web development is all about other people ripping you off. Think about yourself, and how you will contribute to your own development, not how others will. :)

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Other’ is closed to new topics and replies.