HOME       >>       Programming

Javascript : No Right Click Script !@ This script will allow you to protect your source coad


This script will help you to protect your source code


Add this to <BODY> Section of your site !



<script language=JavaScript> var message="Function Disabled!"; /////////////////////////////////// function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script>



Thank You !


Notice from BuffaloHELP:
Use proper bbcode tags when posting codes. We have Programming > Javascript dedicated section. Moving.


Thanks for the script. But if you do a web search, you can find many more similar scripts with advanced functionalities along with "no right click".


Does it work when you press CTRL+F3 in Opera?What about CTRL+U in Netscape and Firefox?Will it block View > Source in most browsers?I haven't tried it yet. Just consider saying "Block Right-click Menu" instead of "Protect your Source Code". That way people will be less confused.


This script is widely availabe in the net. Try to get some script that makes it not possible to view the code using, View> Source.


I've seen this type of script before. In my opinion it is kinda useless. I say this mostly because in virtually every browser you can click on the "View" menu and then choose "Page Source" from the list...which will accomplish the exact same thing.As a matter of fact, I don't believe I've ever seen this code deployed on a professional site...usually only on hastily made blogs, etc.I hand code all my pages, and honestly wouldn't really care if someone copied pieces of the code (ignoring php for a moment). Most of the time it is entirely specific to my page, so the amount of effort required to change/contort it into being used in something else would probably be close to just rewriting it from scratch. As they say, "limitation is the highest form of compliment."If you are really concerned about keeping the coding of your site secure then you should either a) encrypt the entire thing and then parse it through a filter (this will greatly increase the cpu usage on your server, as well as requiring more time for the page to load); or purposefully write incredibly convoluted code that no one but yourself can understand (which is a waste of time, and probably won't be nearly as efficient as a correctly written page would be). In other words, I'd say both options are kind of a waste of time.Just my 2cents.


Ya I have used that before but the Control + C still usually works for the ones I have tested anyway. I don't know if there will ever be a fool proof script that can keep people from copying but that does help. You just have to find a way to stop from the selecting of text on a screen like making it into pictures but that would take too much time.


In most cases, at least those persons using iExplorer, you can save the whole page including all graphics by going up to File> Save As. There are so many tricks to copying sites I don't see how it can be totally prevented. But, remember, it is a great compliment when somebody wants to imitate your work.


Hmm Disabling right click. I ahve heard of that. I tried right clicking one time. I message poped up saying Hahaha Nice try no doing that here. But it is still possible to copy ever piece of that Site. Easily. Unless you are not smart enough too.


This script actually is used to fool internet users that have little experience in it... Practically, all of us here knows how to work our way around with it, with a simple View --> Source method! Perhaps its better without the script so as to save the loading time of your webpages...


I know a trick to bypass that protection code, of course you can just click the edit menu or whatever and then click view source code, and that works in many browsers, but my trick does not use that, it is a trick with the keyboard buttons.The trick:Right click in any part of the pageThen a box will appear saying that you can't do it, or whateverThen don't release the right clickat the same time, click ok with the left mouse without releasing the right click, then release the right click, and voila, the right click functions will appear.Anyway, the best is to encrypt the source code of the page, not only for protect your work, but also to protect yourself from the google hackers.


If you want to hide your HTML Source, giving some 'disabled right clicks function' is not enough. If user want to see your source, it means he knew HTML and trick like that will not stopping them.Just click View->Page Source, your source will come out!. So the better method you can use is to encrypt your HTML source using HTML encryptor. I think you've heard about it right?.Just go to uncle google, then type 'HTML Encryptor' or may be 'Free HTML Encryptor' (I'm poor men...! LOL)


I have seen these scripts before; they are totally useless in any browser other than IE. With these "other browsers", you can very easily disable changing of right click actions. In short, there are very few (but still some existant) ways to secure your source code.


Can not disable Right Click in opera

Javascript : No Right Click Script !@


From m y experience I came to know that Opera browser doesn't support any scripts tht are written to disable right click. I there is a way to disable right click in opera pls share it... This would be very helpful


-reply by kalyan


hey guys why not make a full flash website? this way if any1 tries to copy they have to do it the harder way (if theres a way) and if they really imitate it that means urs is nice(so they spend hell lot of time trying to copy) and your just wasting that guy's time... Plus flash provides great versatility and interactivity!-reply by some1


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.