Skip to content

Instantly share code, notes, and snippets.

@sunmughan
Created April 20, 2017 08:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunmughan/e20b6bb297279e4b24dfe7ac4dbc5da0 to your computer and use it in GitHub Desktop.
Save sunmughan/e20b6bb297279e4b24dfe7ac4dbc5da0 to your computer and use it in GitHub Desktop.
Disable Copy Paste Script For Blogger
<!-- www.droidadda.org Start disable copy paste -->
<script type='text/javascript'>
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) &amp;&amp; isCtrl == true)
{
// alert(&#8216;Keyboard shortcuts are cool!&#8217;);
return false;
}
}
var isNS = (navigator.appName == &quot;Netscape&quot;) ? 1 : 0;
if(navigator.appName == &quot;Netscape&quot;) document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
return false;
}
function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
</script>
<!-- www.droidadda.org end disable copy paste -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment