Google+ ALLHACKD: Disable Right click

Disable Right click

Friday, 31 May 2013




    I Have noticed, that many  web sites or blog's do not allow their visitors to click Right  button of mouse pointer. This option is useful for the owners of that site or blog, who want to avoid the possibilities of the content direct copying to other posts.
     Right click of mouse pointer is very important element and we must use it when it comes to copy or editing texts and etc. but some people may use it in a bad way, and you may want to make click right disabled on your blog. to protect you text, images links etc.
    So these can possible for disable right click on your site or blog by using a simple HTML code.
  To setup this tool in your blog Copy the Following code and paste it to your blog by adding a new page element.
Step 1 : Go to Dashboard > Layout > Add Gadget > HTML / JavaScript

Step 2 : Copy the the following HTML CODE and paste it in that blogger widget.
 
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By allhackd
//For full source code, visit http://www.allhackd.blogspot.com

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>

Step 3 : Save the html/javascript and view you blog.

When you will try to do right click, a the pop up window will appear that “Function disabled” , and if you want to change this words” Function Disabled” Then simply find it in code and replace it.

 

But there is some problem if user click again then another potion will appear that is,“prevent these page from creating additional dialog”


 as you see if user click on that option and then OK button then right click option will appear again.
so that's a small problem in theses trick.

0 comments: