1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable Copy Paste

Discussion in 'XenForo Questions and Support' started by Sirchade, Mar 31, 2012.

  1. Sirchade

    Sirchade Member

    Hello, quests is stealing my forum documents all time. I trying disable RIGHT CLICK and CTRL + C

    I find it this code, but i cant use this. Anyone can help me there?

    Code:
    function noMenu() {  return false; } // its right click event  function disableCopyPaste(elm) {  // Disable cut/copy/paste key events  elm.onkeydown = interceptKeys   // Disable right click events  elm.oncontextmenu = function() {  return false  } }
    function disableCopyPaste(elm) {
            // Disable cut/copy/paste key events
            elm.onkeydown = interceptKeys
         
            // Disable right click events
            elm.oncontextmenu = function() {
                return false
            }
        }
     
        function interceptKeys(evt) {
            evt = evt||window.event // IE support
            var c = evt.keyCode
            var ctrlDown = evt.ctrlKey||evt.metaKey // Mac support
     
            // Check for Alt+Gr (http://en.wikipedia.org/wiki/AltGr_key)
            if (ctrlDown && evt.altKey) return true
     
            // Check for ctrl+c, v and x
            else if (ctrlDown && c==67) return false // c
            else if (ctrlDown && c==86) return false // v
            else if (ctrlDown && c==88) return false // x
         
            // Otherwise allow
            return true
        }
    

    And body tag:
    <body oncontextmenu="return noMenu();" onkeydown="return disableCopyPaste();">

    Thanks!
     
  2. Floris

    Floris Guest

    Completely useless.

    Everything that's rendered client side is visible, disabling javascript would void your protection.
     
  3. borbole

    borbole Well-Known Member


    Try this:

    Disable right click for guests on your forum
     
    Sirchade likes this.
  4. Sirchade

    Sirchade Member

  5. melbo

    melbo Well-Known Member

    Use tynt.com and at least have a chance at getting a linkback to copied text.
    Personally, I never return to a forum that has attempted to restrict the use of my mouse buttons.
     
  6. bambua

    bambua Well-Known Member

    Tynt is really pretty nice, gives you some good insight into what people are doing, and at least gives you a chance at a link back without annoying your guests.
     

Share This Page