How do I disable the mouse right-click?
"By the way, if your skill level is such that you didn't already know the answer to this one, it is quite impossible that you've produced anything worth hiding."
A web designer cannot hide his website's HTML source code, it's just not possible. There will always be a way to get the HTML source, since it is always needed by the browser before the page can be rendered.
If hiding the HTML source is so important, then the following method has been know to work reliably: Lock a copy in a safe. Delete it everywhere else. Drop the safe into a deep sea trench. Detonate a big nuke down there.
Blocking right-clicking scripts just causes more hassle than good, a visitor can simply turn off JS and 'right click' all he wants. Trying to block a right mouse click also prevents the visitor from right clicking a link to open a new window, guess what happens? They leave your site and don't come back.
Breaking right-click scripts
- in IE: copy
javascript:document.body.onmousedown=null;
and paste in the location bar will defeat right click scripts on a page by page basis - you can add it as a link to your links bar, and then it's a one click action. You can drag this enable right-click menu bookmarket to your links bar. - First, right click, but hold the mouse button down. Then hit 'Enter' to cancel the popup. Now let go of the right mouse button and the menu will appear!
- Context Menu Key: Windows keyboards have a key in between the windows key and the Ctrl key, (that looks like a little menu with a highlighted row and a little cursor pointing to it on it) which acts as a right click. so if you have this then simply click the image, not enough so that the link follows through but enough that the picture is highlighted (for example, click the image hold the mouse button down, then drag the mouse off the image, then release) then press the key and the right click menu will show up. For people without such a key on their keyboards,
Shift+F10
should do the same thing, at least on Microsoft products.