SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Mar 2000
    Location
    dublin,leinster,ireland
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The following is a small script i composed that will disable right click. People can probably still view your source through "View Source" but they cant right-click on your site!

    <script language="JavaScript">
    <!--
    function mouseDown(e) {
    if (parseInt(navigator.appVersion)>3) {
    var clickType=1;
    if (navigator.appName=="Netscape") clickType=e.which;
    else clickType=event.button;
    if (clickType!=1) {
    alert("Right Click Disabled !\nDon't Steal Kiddies.");
    }
    }
    return true;
    }
    if (parseInt(navigator.appVersion)>3) {
    document.onmousedown = mouseDown;
    if (navigator.appName=="Netscape")
    document.captureEvents(Event.MOUSEDOWN);
    }
    //-->
    </script>

    ------------------
    o|mantis|o

  2. #2
    SitePoint Enthusiast Morpheos's Avatar
    Join Date
    Feb 2000
    Location
    Miches, DR.
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you can still view the Source through:
    "View Source" then its no big deal to put this script on the page.

    explain.

    ------------------
    Morpheos - Web Developer
    Digital Works Web Design/Development
    morpheos@carib.com



  3. #3
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All it accomplishes is annoying your visitors. Many right click to open a link in a new window, to create a shortcut, or to print. I can't imagine anything good coming out of these scripts.

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Actually I am working on one, as an educational experience to myself, that will allow them to open links in a new window, print a page or even save those images marked as saveable. I think it will be a good learning experience in the lengths I can take both javascript and cross-browser DHTML.

    ------------------
    Wayne Luke
    Internet Media Provider

  5. #5
    SitePoint Zealot
    Join Date
    Dec 1999
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this and you'll be able to do right click even using that script.

    Hold the left button
    Then hold the right button.
    Next release the left button.
    And finally realese the right button.


  6. #6
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SPeaking of hiding source code, check http://wsabstract.com . Check the forums and the javascript programming forum. We have a topic dealing with hiding source code..it can be broken, but a lot of people won't break it...

  7. #7
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone can just extract the source code from their browser's cache.

    the only way to really protect it is to write a script that scrambles the source code...[shrug]

  8. #8
    mouse monkey
    Join Date
    Dec 1999
    Location
    UK
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also surfers with a browser that doesn't support javascript or people that turn javascript off can still view your source.

    Fletch


  9. #9
    SitePoint Member
    Join Date
    Jul 1999
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've seen a few sites that put huge spaces in between there lines of html. Ofcourse, this makes no difference to the browser view but trying to view it in notepad/wordpad etc is very annoying and can put people off right away.

    However, they will still be able to save the page and load it into there html / wysiwyg editor and it will probably cause the file size to increase somewhat and hinder the download time.

    An example of this is www.yell.co.uk

    ------------------
    Make Your Site Sell!
    http://www.sitesell.com/websales7.html
    Worth Its Weight In Time!


  10. #10
    SitePoint Zealot
    Join Date
    Jan 2000
    Location
    CT
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    check this site out... they can change the HTML and totaly put it in Javascript..
    http://www.javascripts.com/repository/script20624.html

  11. #11
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE4.5 for Mac will (I believe) show the expanded Java code as it is displayed by the browser (more of a bug than a feature).

    I can't imagine why you'd want to hide your source code anyway.

    Owen


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
  •