« Previous | Main | Next »

Disabling Right Click on Your Website.

July 30, 2012 | Greg Astill | Comments (2) Facebook Twitter More...

I’m not a fan of this operation, but I do see the reasoning behind why I get asked it all the time.  Photographers and artists seem to ask more and more, because it’s their lively hood at stake.  There are so many ways to download images from a website, but the most popular is for the user to right click on the image and choose Save Image As

Firefox-save-as

It’s not just for images/graphics; you can also prevent someone from taking some of your code from your website.  You can help encrypt and protect all aspects of your website with the following HTML codes. No right click block is 100% effective, but it will help against novices.

You can see the below example by clicking here

<SCRIPT TYPE="text/javascript">
<!--
//Disable right click script
//visit http://www.rainbow.arch.scriptmania.com/scripts/
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(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=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>

Use the script below so when someone right clicks to save an image off your page they will be blocked.  It can either be blocked with by doing nothing or you can have a message appear letting the user know that the function was disabled.  You can also personalize the message if you’re up for it.

Disablefunction

You can retrieve the code and see the above example by clicking here.

This script may not work in all browsers, and is not foolproof.  But it’s certainly a great start.  If someone really wants something from your page they can easily find ways around it.  It’s more or less a warning for people who might want to take your graphics without thinking of the ramifications. 

The best way to fully protect your images, artwork and graphics is to ensure that the ones you upload are at a resolution and quality that can only be used for online purposes.  A lot of websites incorrectly put up images that are at a size that way exceeds what is required, and this has a major impact for two reasons.  The page the images appear will download at an incredibly slow pace, and if the user wants to print the image out there’s nothing in place to stop them.

Here's an approximation of how the same image can appear great on screen one way, but if you try to print an image that's on a website at a low DPI or resolution the quality just isn't there anymore. 

1

2

This is the safest way to protect your images.

Have fun!!
Greg

Comments

Welcome to the Digital Design Studio Blog. This blog is completely devoted to providing the latest information on all things digital. As we all know it can be hard to keep up with technology, this blogs purpose is to help you with that. Get the latest information on scanning, digital photography, websites and launching your business online.