Code Disable Right Click in Blogger

Code Disable Right Click in Blogger

Go to download
#1

 



In this post I will show you how to disable right click on Blogger web pages. Code Disable Right Click in Blogger. Previously, we added block copy code in blogger blog, so that some people copy our content using right click and save our blog page offline, here we learn about "disable right click on blogger blog".


These are the steps that we will follow in today's explanation:

  • Step 1. Go to Format in Blogger Dashboard and click on Add Widget Link.
  • Step 2. Choose the HTML/JavaScript link.
  • Step 3. Paste the following code in the content area and then click the Save button.


<script language=JavaScript>
<!--
//Disable right mouse click Script
var message="No copying!";
///////////////////////////////////
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>

  • Step 4. Go to your Blogger blog and test it by right clicking on the blog.

You can also add JavaScript code in template codes

To add this tool to the template code, go to the template and click on Edit HTML

 Then I search for the code and then paste the following code directly above the code </head>  </head> 

<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener('contextmenu', function (e) {
e.preventDefault();
}, false);
} else {
document.attachEvent('oncontextmenu', function () {
window.event.returnValue = false;
});
}
</script>

That's it, I hope you succeeded in adding the right-click disable code in Blogger.




@BloggerPrince.net


image quote pre code