SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disabling the view source option

    www.smile.co.uk opens a window when you try and use the bank login that does nothing when you click on the right mouse button. Also it has no menu - but that bit is easy.

    How can you disable the menu that is normally displayed with a right mouse button click? I tried catching the event and then not bubbling it but the menu still appeared.

    Cheers,
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firstly, yeah, the no menu is easy. Secondly, you just do an IF on right mouse button command, and then return false. Something along that line. I'll see if I can throw together some code in a few minutes.

  3. #3
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Er, rather, check here: http://www.dynamicdrive.com/dynamicindex9/noright3.htm

    No right, but no popup. Still, having no right click is bad. Sometimes I like to go add to favourites, print, or open link in new window. Without either menus, that's impossible.

    Anyway, good luck with your ventures. If this helped, please rate me well.

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I highly recommend not implementing a no-right-click script on your site. It's annoying and frustrating to users, and someone will always be able to get around it, even if you disable view->source. What happens when I click on ctrl+u in any Mozilla browser, or disable JavaScript? Your script will break, and I can have a field day with your source code. It's not worth it.

  5. #5
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - didn't say I wanted to do it - just wanted to understand it
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    I highly recommend not implementing a no-right-click script on your site. It's annoying and frustrating to users, and someone will always be able to get around it, even if you disable view->source. What happens when I click on ctrl+u in any Mozilla browser, or disable JavaScript? Your script will break, and I can have a field day with your source code. It's not worth it.
    Could you possibly post the code needed to disable view->source and no-right-click? I see that sitepoint forums (new thread page for instance) haven't disabled rightclicking, but selecting view source from the rightclick menu or from the top view menu in IE doesn't work either...

  7. #7
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Florida
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my opinion, disabling right-clicking is as cliche as blinking text or having an animated image follow the mouse cursor. Like vgarcia stated, anyone who knows the system well enough can view your source code, and the only real safe way of protecting your code is to not put it online.

  8. #8
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by torkil
    Could you possibly post the code needed to disable view->source and no-right-click? I see that sitepoint forums (new thread page for instance) haven't disabled rightclicking, but selecting view source from the rightclick menu or from the top view menu in IE doesn't work either...
    There is no code to disable view->source. I was speaking hypothetically.

    If you're having trouble with view->source in IE, your cache is probably full. Clean out your temporary internet files, then restart your browser and see if view->source is still gone.


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
  •