/    Sign up×
Community /Pin to ProfileBookmark

Wondering how to hide your source code?

Well, give up right now then, because it is absolutely impossible. “No right-click” scripts and other similar scripts will only end up annoying your users in which actually don’t even want to steal your source code or images, but rather just want to casually use their browser features. Doing things like this will, indeed, drive away some users because they will be confused if once they come to your site they won’t be able to use common features that they are usually able to use.

What it really comes down to is this: if the browser can render the page, and source code can be accessed — and there is nothing more to it. Doing things like using JavaScript to generate the the source code (and attempt to obfuscate it), you are making the page inaccessible to approximately [url=http://www.thecounter.com/stats/2004/September/javas.php]9%[/url] of your visitors (that includes search engines as well). As previously mentioned, “no right-click” scripts are also ineffective because there are several other ways to obtain source without the right-click context menu and moreover, JavaScript can be disabled.

The source code of your site will always be accessible no matter what, it simply isn’t worth trying to hide. Accept that it is impossible and simply don’t waste your time trying to prevent people from accessing it, because you can’t. The more accessible and usable your site is, the more people will be able to use and enjoy your site.

In the case of images, they can also easily be taken from a site no matter what kind of “no right-click” or other scripts you have applied. However, the most practical thing to do is to watermark your images. This will not completely prevent people from attempting to steal it, but it should cut down on the number of people that try to take your images because now there is something on the image that explictly defines it as your work.

Further reading:

[list]

  • [*]

    [url=http://www.lemurzone.com/edit/converse53.htm]Hiding Content[/url]

  • [*]

    [url=http://www.vortex-webdesign.com/help/hidesource.htm]How to Hide Your HTML Source![/url]

  • [*]

    [url=http://www.webdeveloper.com/forum/showthread.php?s=&threadid=26778#post141132]Vladdy’s opinion on the matter[/url]

  • [*]

    [url=http://www.webdevfaqs.com/general.php#protectimage][i]WebDevFAQs[/i]: How can I keep people from saving my images?[/url]

  • [*]

    [url=http://www.webdevfaqs.com/general.php#protectsource][i]WebDevFAQs[/i]: How can I hide my source code?[/url]

  • [/list]

    to post a comment
    JavaScript

    0Be the first to comment 😎

    ×

    Success!

    Help @fredmv spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.27,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...