Translate This Blog
Always Remember To Back Up Your Template Before Attempting Any Of The Tweaks On This Site

Do to error codes you should use the old interface when attempting many of these tweaks to your template

Disable Right Click Blogger

Have people been stealing your images or content from your blog? Well with this script you can help protect your content by disabling the right click option. This script is not full proof and anyone who is computer literate will be able to get around this. However this will make it harder for people to steal your content and it may stop the idiots all together.

If you want the right click option to be disabled on all pages in your blog then follow the instructions below. If not then you can just place the code in the post that you want to disable it in. Make sure if you paste it in a post you do so in Edit HTML mode.

If you feel uneasy about adding coding directly into your template you can add this code into a HTML/javascript gadget instead. But its better to add it through your template for best results because some scripts may have a bleed over effect on your Page Elements as well. 

Design--> Edit HTML--> Ctrl+F--> Input </head> in the Find bar that comes up.

This should locate the </head> tag in your HTML page.

Place this code directly above the </head> tag.
<script type="text/javascript">
document.onmousedown=disable; //IE
message="Sorry no right click on this page!";
function disable(e)
{
if (e == null)
  { //IE disable
  e = window.event;
  if (e.button==2)
    {
    alert(message);
    return false;
    }
  }
document.onclick=ffdisable;  //FF
}
function ffdisable(e)
{
if (e.button==2)
  { //firefox disable
  e.preventDefault();
  e.stopPropagation();
  alert(message);
  return false;
  }
}
</script>
You can change the text in red to the alert message you wish to display when someone right clicks.

12 comments:

  1. Thanks so much for this. I had to mess about some to find where to put in the script, but it works. I even customized it! look and see, http://robins-chaos.blogspot.com

    ReplyDelete
  2. Hi I tried to find this but could not locate the head tag? would it be because of the template I use? kriznizzel/blogspot.com/
    Thanks

    ReplyDelete
  3. thank for your sharing
    curry on friend...:)

    ReplyDelete
  4. unfortunately this did not work for me when I tested it :(

    ReplyDelete
  5. You might have JavaScript disabled on your browser or your browser does not support it.

    ReplyDelete
  6. Another question for you Aires! I am trying to add this into a single post. When I ctrl- f'd the edit html part of my post, not only did the exact head tag you mentioned not show up, the word 'head' didn't even appear. Any ideas?

    ReplyDelete
  7. If your using the new dashboard it renders the HTML code page in iframe or AJAX and the browser find box will not be able to find the tag requested. You can switch to the old dashboard or scroll through the coding and find it manually. In most blogs the head tag is found about 60-80% down the page.

    ReplyDelete
  8. No, I even pasted the whole code into Word and ctrl F'd- nothing :( It just isn't there!?

    ReplyDelete
  9. If your using a 3rd party template they may have tweaked the template coding with additional tweaks which would stop it from being pulled up if the head code was tweaked. The head tag must exist because it is part of a HTML documents standard structure. Send me a email through the contact at the top of this blog. It will not let you add the full template coding in the email but once I reply back you can do so.

    ReplyDelete
  10. Tahnks a lot, man, very useful tool.... :)

    ReplyDelete

Web Design Blogs PageRank