Simple one step method to disable right click on your webpages to prevent users from stealing your text or images easily.
You may have seen many websites (e.g. this page) that don't allow its user to right click and copy their content easily, wanna know how to do this on your website? If yes, then this post is for you.
Only thing that you need to do is to add simple JavaScript anywhere on your webpage, blogger users can add it to HTML of their template just before the
JavaScript Code:
<script type="text/JavaScript">
//Script courtesy of www.ywfyouthvoice.com
var message="NoRightClicking";
function defeatIE() {if (document.all) {(message);return false;}}
function defeatNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;}
else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;}
document.oncontextmenu=new Function("return false")
</script>
Note: How to copy without right click? Two methods -
(i) Highlight it by clicking and holding your mouse button down and dragging the cursor from the beginning to the end of the code, then release the mouse button. When you have the code highlighted, press Ctrl + C on your keyboard to copy it.
(ii) You can simply copy script from this page.
Will this make my content completely copy proof?
No, nothing can make your content 100% secure! I'll soon write a post on this topic, stay connected to our social media accounts for update.
You can make your content more secure by disabling text selection on your website, read: Easiest Way To Prevent Users From Highlighting And Copying Your Website or Blog Text
Can a user bypass this JavaScript protection?
Yes, very easily. Since it is JavaScript, it doesn't work if the visitor has JavaScript disabled or has a browser that doesn't support JavaScript. That isn't very many users, but anyone with some experience would know a way around this trick. It will stop most new users though, and at least make it harder for everyone else. That may be all the discouragement they need to move on to easier pickings.
For any queries you can comment below in the comments section.