6 Replies Latest reply on May 12, 2010 3:47 PM by will-martin

    Disable right mouse click script

    grusvag

      Does anyone have any thoughts about this? One of my clients has asked about adding this code to our site in an effort to prevent people from easily downloading our images (he's a photographer). Seems to me they could still very easily do a screen capture but I guess any kind of prevention would be helpful. I just do enough scripting to know if this script is safe and/or effective.

       

      http://www.dynamicdrive.com/dynamicindex9/noright.htm

       

      -John

        • 1. Re: Disable right mouse click script
          John Waller Adobe Community Professional & MVP

          Scripts are easily circumvented and usually a waste of time. And the truth is that any image on a web page has already been downloaded to the browser cache on the local machine.

           

          The intention behind the idea is usually to prevent casual users downloading easily.

           

          For a photographer, I would simply watermark the images. They're too low res to be used for anything other than cutting and pasting onto another web page anyway.

          • 2. Re: Disable right mouse click script
            Nancy OShea Adobe Community Professional & MVP

            It's a waste of time.  The way the web works you click on a link to a web page.  Everything downloads for viewing in your browser.  If the images didn't download, you wouldn't see anything.

             

            As you say, disabling right click is very easy to defeat by taking a screen capture or disabling JavaScript.  You're not going to stop thieves this way.  Instead you annoy honest people who need right click for advanced browser functions.

             

            The best you can do is use low res images and watermark them heavily so nobody will be interested in using them on their own site.

             

             

            Nancy O.
            Alt-Web Design & Publishing
            Web | Graphics | Print | Media  Specialists
            http://alt-web.com/
            http://twitter.com/altweb
            http://alt-web.blogspot.com

            • 3. Re: Disable right mouse click script
              grusvag Level 1

              Thanks for your thoughts.

               

              While I don't understand how the average person would access images "downloaded" to the browser cache (I wouldn't even know how to do that), I do agree that there's not much you can do to prevent someone from stealing our original photos from the website if they're determined, all we can do is take steps to at least make it more difficult and advise them that they are not free for public use and to register them with the Copyright Office.

               

              I guess my question was more about the quality of the script that was recommended to us. I'll probably just test it out on a duplicate page or something and see if it works.

               

              What sort of "advanced browser functions" would people be doing with a right-click?

              • 4. Re: Disable right mouse click script
                John Waller Adobe Community Professional & MVP
                function(){return A.apply(null,[this].concat($A(arguments)))}

                While I don't understand how the average person would access images "downloaded" to the browser cache (I wouldn't even know how to do that),

                 

                In Firefox, type about:cache in the address bar.

                 

                In IE8, Tools > Internet Options, under Browsing History click Settings > View Files

                 

                function(){return A.apply(null,[this].concat($A(arguments)))}

                What sort of "advanced browser functions" would people be doing with a right-click?

                 

                Right click in a browser window and the context menu offers a dozen or more commands: save picture as, create shortcuts, view source, various PDF options etc. The entire context menu is disabled by the script for the sake of denying a user access to the Save Picture As... command

                • 5. Re: Disable right mouse click script
                  will-martin

                  Disabling right-click is never a good idea.  It will not stop anyone with minimal tech savvy from getting the images, and it will inconvenience people who use the default options of the menu.

                   

                  For example, I often use the "Back" and "Forward" options on the right-click menu in Firefox because it's faster than moving my mouse all the way to the top of the screen.  Similarly, many people use the right click menu for copying and pasting text, or using "Select All" or similar.  Disabling the whole right-click menu will necessarily disable each and every function it is capable of performing.

                   

                  Meanwhile, getting the images is dead easy even if you put the script in.  People could:

                   

                  1) Disable JavaScript temporarily, save the image, and then turn it back on.

                   

                  2) View the browser's cache and get it from there (a quick Google search for "view browser cache" will tell anyone how).

                   

                  3) View the source code, find the IMG tag, and then just paste the path from the SRC attribute onto the current address.

                   

                  4) In Firefox, open the preferences/options panel, go to the "Content" tab, find "Enable JavaScript", and click the "Advanced" button next to it.  Remove the check from the box allowing "disable or replace context menus".  This will make Firefox ignore the script for replacing the context menu even while all other JavaScript is active.

                   

                  5) Also in Firefox, you can just drag the image you want from the browser window to your desktop.  This will work on any image that was put in place using an IMG tag (but not on CSS background images).

                   

                  6) Also in Firefox, going to Tools > Page Info and clicking the Media tab will show you a list of all images in the page and let you save them wherever you like.

                   

                  7) In basically any browser, you can do a File > Save Page As and have it grab all the images as well as the code.

                   

                  There are probably other ways too, but I can only think of seven off the top of my head.

                   

                  Soo ... disabling the context menu will annoy any visitors who want to use it for a legitimate purpose.  At the same time, it won't stop an even mildly determined crook.

                   

                  And finally, it'll give the owner of the site a false sense of security.  When somebody circumvents the script, the owner's going to be asking YOU what went wrong.  It's just a losing proposition all around.

                  • 6. Re: Disable right mouse click script
                    Nancy OShea Adobe Community Professional & MVP

                    What sort of "advanced browser functions" would people be doing with a right-click?

                     

                    Among other things, Right click allows you to open links in new windows or new tabs.  Bookmark pages, Save links, open web developer toolbars and other add-ons.  Ditto for certain web assisting technologies.

                     

                    Why don't you try using right click sometime.  It will open up a whole new world of browsing options for you. And once you get used to using it, I guarantee you won't appreciate it when a web site tries to take it away from you.

                     

                    The Golden Rule on the web is "don't mess with my browser." 

                     

                    If this is such a big worry, why don't you display your photos in a Flash Gallery?  That will pretty much solve the problem.

                     

                     

                     

                    Nancy O.
                    Alt-Web Design & Publishing
                    Web | Graphics | Print | Media  Specialists
                    http://alt-web.com/
                    http://twitter.com/altweb
                    http://alt-web.blogspot.com