SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    disable right click in a popup window

    Hello ..

    I have a popup window which grab page from another server.

    i want to disable the right click on the popup

    here is the code:

    Code:
    <script type=text/javascript>
    <!--
    var win= null;
    function NewWindow(mypage,myname,w,h,scroll){
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var settings ='height='+h+',';
    settings +='width='+w+',';
    settings +='top='+wint+',';
    settings +='left='+winl+',';
    settings +='scrollbars='+scroll+',';
    settings +='resizable=yes';
    win=window.open(mypage,myname,settings);
    if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
    }
    
    function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL,winName,features);
    }
    //-->
    </script>
    Code:
    onclick="NewWindow('$url','name','800','150','no');return false"
    any help would be great Thanks ....

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,609
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    1) Why? You think that's going to stop someone getting at the data/content of what is shown in the popup window?

    2) Plenty of 'disable right click' examples in a Google search. This script would need to run in the page shown within the popup.
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    siteguru is right - and I will add a few more points:

    3) In Opera and Firefox the user has the option of allowing or disallowing script-control of right-clicks. Script control of right-clicks is possible in IE and this demo shows how to do it.

    4) Because of cross-domain security, script in the parent window will not have access to the page in the popup.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello ... I know that it's not a good way to protect pages... but at least it will keep newbies out of my links ...

    I have files uploaded on megaupload and i want to make the links only work from my site & because their is something goes wrong when i try to iframe a megaupload link in IE so i was wondring how can I protect this links ...
    gonna lose my mind

    Does any body know a new way to do this ?

    Thanks for your reply ...


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
  •