Is there anyway you can stop people viewing your source code in there browsers?

Discussion in 'Programming' started by wivngeh, Dec 7, 2011.

  1. wivngeh Member

    Member Since:
    Nov 30, 2011
    Message Count:
    39
    Likes Received:
    0
    Is there anyway you can stop people viewing your source code in there browsers? by that i mean im building a website and im spending alot of time on it and i dont want people to take bits and pieces from it.i'm kind of answering my own question here by saying no you cant but maybe someone else has a different view?
  2. Elia Member

    Member Since:
    Nov 17, 2011
    Message Count:
    32
    Likes Received:
    2
    Location:
    Timisoara
    Encrypting your code in hexadecimal strings using javascript would be the only solution that guarantees a certain level of obscurity, but that slows the site awfully. If your code is really revolutionary and you don't want to have others using it, why don't you patent it? Otherwise, I see no point in hiding it, it's public anyway.
  3. Farbyte Member

    Member Since:
    Jun 21, 2011
    Message Count:
    36
    Likes Received:
    2
    Location:
    UK
    if it is client side javascript, HTML, etc. the answer is no. the only thing you can attempt is obfuscation as mentioned by Elia. I believe using flash makes things a bit harder too, but haven't tried.
  4. Olga Member

    Member Since:
    Aug 7, 2010
    Message Count:
    58
    Likes Received:
    0
    No you can not.
    I understand you spend a lot of time on building it but is the html/javascript code so special ?
  5. sitefocuz Member

    Member Since:
    Apr 28, 2010
    Message Count:
    142
    Likes Received:
    2
    You are missing the basic point. Anything you send to the client application, can be seen by anyone. Even if you do some silly tricks to make a browser hide it, I can write an HTTP client that mimics a browser and make it display all the content, in couple of minutes.

    All that connects to your server give user agent similar to a browser need not be a browser at all. Anything you send to a browser will be readable to any HTTP client and so, to anyone who can connect to your server.

    This eagerness to hide HTML source remind me of early dotcom days. People understand the basics now and such questions are rare.

    My advice is - stop giving too much importance to yourself and stop believing that people are out to fetch your smart code. Web doesn't work that way. If you are able to do something great, you will succeed. Copycats rarely overtake originals and first over advantage is very important. Spend your time and effort on creative thinking and avoid paranoia.
  6. SolidShellSecurity Member

    Member Since:
    Dec 31, 2011
    Message Count:
    47
    Likes Received:
    1
    You can hide javascript in the session layer if you use PHP
  7. ThrivingDad New Member

    Member Since:
    Jan 7, 2012
    Message Count:
    19
    Likes Received:
    1
    You can use javascript to make it harder for them to view it. But there is no way to stop a determined person from seeing your front end code unless you are using actionscript/flash.
  8. lewis.112 Member

    Member Since:
    May 27, 2010
    Message Count:
    145
    Likes Received:
    10
    Occupation:
    SEO
    Using encryption of the code you can hide the original code my friend...
  9. w3rack New Member

    Member Since:
    Apr 26, 2012
    Message Count:
    28
    Likes Received:
    0
    Yes, encryption is the only way for this.
  10. kenrylesso Member

    Member Since:
    Apr 5, 2012
    Message Count:
    44
    Likes Received:
    1
    Although Encryption is the way todo it, but if you will use such thing then its also possible that it become difficult for Google crawler to find you. So there is no need todo it.

Share This Page