Results 1 to 6 of 6

Thread: Blocking right click on website

  1. #1
    Join Date
    Dec 2009
    Posts
    58

    Blocking right click on website

    hello friends I own a website and i want to block the right click on my website that is none of the visitor must be able to right click on my website. Also the visitors must not be able to save my web page. Please tell me how can i block the Right click on my website and unable saving of the web page. Need serious help.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Blocking right click on website

    As far as i know it is possible to ban the right click on a web page so that all your image and content can be protected against copying or stealing images or even copying the content. But the user can still steal or copy the source code regardless of blocking the right click mouse function. Simply make use of the no right click script.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: Blocking right click on website

    Most probably its impossible to achieve this functionality which you have mentioned in your query. because if somehow you achieve this functionality. Your content can still be copied by the the visitors. Also you can't block saving of the web page. because it gets automatically saved in the browaser cache or in the temp folder.

  4. #4
    Join Date
    Nov 2005
    Posts
    1,323

    Re: Blocking right click on website

    Using the no right click script will definitely help you in this matter so i would request you to make use of the script i have also mentioned the no right click below place this segment of code in the head section of your HTML code


    <script language=JavaScript>
    <!--
    var message="";
    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>
    Last edited by absolute55; 22-01-2010 at 09:02 PM.

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Blocking right click on website

    Use the code which i have mentioned below in your HTML documents head tag this will not allow the visitor to right click on your website. The mouse handler used under this code will not disable the right click on this website. This code will work in almost every browser

    HTML Code:
    <script>
     var isNS = (navigator.appName == "Netscape") ? 1 : 0;
      if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
      function mischandler(){
       return false;
     }
      function mousehandler(e){
     	var myevent = (isNS) ? e : event;
     	var eventbutton = (isNS) ? myevent.which : myevent.button;
        if((eventbutton==2)||(eventbutton==3)) return false;
     }
     document.oncontextmenu = mischandler;
     document.onmousedown = mousehandler;
     document.onmouseup = mousehandler;
      </script>
    Last edited by MindSpace; 22-01-2010 at 09:09 PM.

  6. #6
    Join Date
    Dec 2009
    Posts
    58

    Re: Blocking right click on website

    Thank you very much for the replies. Finally i got the solution , Now the right click has been disabled on my website but i can still press the ctrl key and hence i can copy the content from it can you please suggest me a solution so that i can disable the ctrl key too on my website because using the no right click script still not solves the problem.

Similar Threads

  1. ESET Smart Security 5 Firewall keep blocking a website
    By Akolekar in forum Networking & Security
    Replies: 9
    Last Post: 25-11-2011, 10:26 PM
  2. MBAM blocking access to malicious website
    By HoGaN 77 in forum Networking & Security
    Replies: 3
    Last Post: 13-12-2010, 07:20 PM
  3. Blocking a Website in Internet Explorer 7
    By Computer_Freak in forum Tips & Tweaks
    Replies: 0
    Last Post: 04-03-2009, 08:52 PM
  4. Blocking a website
    By Kaseyheart in forum Vista Help
    Replies: 4
    Last Post: 16-10-2007, 03:01 PM
  5. Blocking website URLs in SBS 2003
    By saathii in forum Small Business Server
    Replies: 3
    Last Post: 25-04-2007, 04:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,679,015.65858 seconds with 17 queries