disable right click

Discussion in 'HTML & Website Design' started by freebanner, Apr 24, 2009.

  1. #1
    whats the code for disabling right click?

    their seems to be a few versions that work for certain browsers but not all.

    Is there code that works on all browsers? or most, ie, firefox, chrome?

    post it here please, ill rep u

    thanking you in advance. :)
     
    freebanner, Apr 24, 2009 IP
  2. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There isn't one that works in all browsers. Anything you put on the internets, is public. Unscrupulous nerds will always, always, easily be able to take anything you have for their own. Sorry for the bad news, but that's the way it is. Every technique out there is easily circumvented, especially with Firefox (but it's not the only one).

    So, don't put stuff you don't want stolen on teh interwebs. For images, only display the small, jpg-artifacted, or watermarked version (if you need to show an image to potential clients for example). You keep the full, pretty version elsewhere-- not even on the web hosting server but another machine.

    I have a site where I have images that aren't copyable with right-click (unintentional byproduct of a technique I am using) but they can still just go into the HTML source, find the names, and navigate directly to them.

    It's considered both rude and amateurish to disable right click. You'll likely get a number of people saying you shouldn't disable it, not even with Javascript. It's like stealing someone's Back button. Or stealing candy from their baby.
     
    Stomme poes, Apr 24, 2009 IP
  3. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    819
    Best Answers:
    7
    Trophy Points:
    320
    #3
    By definition ALL content must be UPLOADED TO THE USERS COMPUTER BEFORE it can be viewed in his browser.

    Once the content is on his computer, you totally lose control over how that content is used. And once it is on his computer, he can find it and access it in numerous ways which you CANNOT PREVENT. All you can do it make it harder to access, but in the process you will chase away far more people you want on your site than people who will actually do something negative with the content you provided. Can you afford to lose THOUSANDS of customers for every bad egg out there?

    The ONLY guaranteed way to keep people from copying content, is to NEVER PUT THE CONTENT ON THE INTERNET in the first place. Disabling right click and other tricks will just send your paying customers to your competitors that don't cause them frustration.
     
    mmerlinn, Apr 24, 2009 IP
  4. freebanner

    freebanner Active Member

    Messages:
    727
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    70
    #4
    ^^ agreed with both your comments, its not for me its for one of my clients.

    She has seen her hair product pictures being used on someone elses site. shes reported it, but would like to have right click disabled. I did tell her they can take a screenshot anyway. but The client is always right

    Any coders have the latest script handy?
     
    freebanner, Apr 24, 2009 IP
  5. Michamus

    Michamus Peon

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    IF the culprit is an amateur -- which is usually the case for photo thieves -- I would recommend using a little creativity.

    
    <div style="background-image:imageurl.ext">
    <img src="img/transparent.gif" width="true image width input here" height="ditto">
    </div>
    
    Code (markup):
    What this effectively does is display the image as a background on the div, with a transparent gif blocking the capability of right clicking the actual image. This is truly compatible browser wide.

    Now, a truly determined person, with a decent knowledge of html will be able to pull your page source, but usually people that dedicated are creating their own content anyway.
     
    Michamus, Apr 24, 2009 IP
    freebanner likes this.
  6. gummyworms

    gummyworms Active Member

    Messages:
    126
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    it doesnt matter if some computer nerd will get pass it long as the majority of the internet users dont.

    Ok another thing I just want to mention is that Opera can bypass the right click disable thing. I dont know why but it's doing it, and doing it very well. whenever i go to a right click disable site, i turn my opera on.
     
    gummyworms, Apr 24, 2009 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    The solution, so far as there is a solution, is for her to provide images that are less generic. If they are specific to her business, they will not have value to thieves.

    No, that is not true. It is your responsibility to inform the client of what is and is not possible, and what is and is not reasonable. Were you to implement worthless and unreasonable code, merely as a sop to 'the customer is always right', it would speak poorly of your own professionalism.

    cheers,

    gary
     
    kk5st, Apr 24, 2009 IP
  8. freebanner

    freebanner Active Member

    Messages:
    727
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    70
    #8
    ^^ thanks everyone, ive installed a script to disable right click on all her pages here: www.bellatuhair.com

    shes really happy, and i try and make my clients very happy.

    Thanks all for the advice.
     
    freebanner, Apr 25, 2009 IP
  9. pitagora

    pitagora Peon

    Messages:
    247
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you know guys.....all you have to do is disable javascript. Don't look for complicated way to take like going through the cache or changing your browser. Just disable the javascript and copy :p
     
    pitagora, Apr 25, 2009 IP
  10. rookster

    rookster Member

    Messages:
    160
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #10
    agreed no way around to completely secure your data especially images
     
    rookster, Apr 25, 2009 IP
  11. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    819
    Best Answers:
    7
    Trophy Points:
    320
    #11
    Wrong.

    Total security = never post on internet.
     
    mmerlinn, Apr 25, 2009 IP
  12. freebanner

    freebanner Active Member

    Messages:
    727
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    70
    #12
    ^^wrong

    Total security = never connect to the internet
     
    freebanner, Apr 26, 2009 IP
  13. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #13
    That's the technique I had, for reasons of changing that image on :hover and :focus. it also makes my img boxes empty when someone views without CSS-- borderline iffy for me, since these images are considered content. The not-able-to-right-click them was an unintentional disadvantage.

    It's also great for when you need an HTML image, but need to serve PNGs to modern browsers and gif's to IE6.
     
    Stomme poes, Apr 26, 2009 IP