A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Dont want people right-clicking all over your web page? Use this!

  1. #1
    Remove the asterisks and have fun! Place this inside of your "head" tags:

    <*script language="JavaScript1.2">

    if(window.Event)
    document.captureEvents(Event.MOUSEUP);

    function nocontextmenu() {
    event.cancelBubble=true
    event.returnValue=false;
    return false;
    }
    function norightclick(e) {
    if(window.Event) {
    if(e.which==2||e.which==3)
    return false;
    } else if(event.button==2||event.button==3) {
    event.cancelBubble=true
    event.returnValue=false;
    return false;
    }
    }
    document.oncontextmenu=nocontextmenu;
    document.onmousedown=norightclick;
    <*/script>

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    192
    Thats a pretty neat trick there. I actually might use this one! Thanks!

  3. #3
    FK Times - Editor in Chief
    My Good Little Birdie

    Join Date
    Sep 2000
    Posts
    692
    but couldnt you just go to View > source in ie?

  4. #4
    Senior Member
    Join Date
    Dec 2000
    Posts
    126
    No HTML page is entirely liberated from source access.

    If you go to View->Source and it's a frameset, just use basic HTML knowledge to figure out which tag to look at: look at the SRC part of the FRAME tag to see what the other pages are.

    Then, access it directly.

    There is nothing that can stop people from viewing web source hehe... but your code is a good deterrent!

    Dan

  5. #5
    Registered User
    Join Date
    May 2000
    Posts
    617
    the fun things about stuff like that are you can make really funny pop up messages for when the person right clicks on you...

    but as said, if someone really wants a script or image, or anything, they can get it.

  6. #6
    Eat Rice!
    Join Date
    Sep 2000
    Posts
    299
    don't forget about file>save webpage

    plus... i have a way of still clicking when people use that code........its my secret.

  7. #7
    Senior Member
    Join Date
    Dec 2000
    Posts
    126
    I think I figured that out too, if you hold down the left mouse button or something when you right click it still does the context menu hehe...

    That's probably not it but I remember averting that little security trap a while ago

    hey riceraver, I guess that means we are "l33t hax0rs!"

    Dan

  8. #8
    FK Times - Editor in Chief
    My Good Little Birdie

    Join Date
    Sep 2000
    Posts
    692
    you press enter then right click

  9. #9
    Ugly with a capitol F Ekostudios's Avatar
    Join Date
    Jan 2001
    Location
    Injun-ana
    Posts
    91
    there is no perfect js source blocker, but i've seen some mighty fine ones!
    This is one of them!!

  10. #10

    Another Idea

    Just put everything in a seperate swf file on your site, then when they right click, all they get is the flash player menu......I use this to keep ppl from stealing the custom graffix off my business site....only way to get em is to rip the swf open, and not your average lacky knows how to do that....lol

  11. #11
    Senior Member
    Join Date
    Dec 2000
    Posts
    126
    especially if you protect it from import with a password!

  12. #12
    Eat Rice!
    Join Date
    Sep 2000
    Posts
    299
    yeah.. that's what i did. Just hold down the left click and then right click. Most people don't think of that. The code doesn't protect against two mouse clicks. I'm not sure if a simple javascript could detect that but it probably could be done.

  13. #13
    The Mayberry Flasher OpieNC's Avatar
    Join Date
    Oct 2000
    Posts
    388
    just be glad that people can not view asp or php's or things of that nature. it would make the world of web based programming non-existent!

  14. #14
    FK Board Loser
    Join Date
    Jul 2000
    Posts
    252
    yeah how about Microsoft Frontpage? forgot about that? or how about do a Save as under file? lots of different ways to get content off a site.

  15. #15
    CapTy99.com Webmaster
    Join Date
    Oct 2000
    Posts
    230
    see, what u got to do , is make the page so long no one wants 2 look through it. just put in really long messages with the /* tag and just type crap. i really like to type long messages containing the words "asdf" it seems to detour alot of people from sifting through my wasted time.

  16. #16
    Eat Rice!
    Join Date
    Sep 2000
    Posts
    299
    you can do that but smart people like me will see right through it. Or i can just load the page right into dreamweaver and have it get rid of that useless crap you put in there.

  17. #17
    Senior Member
    Join Date
    Dec 2000
    Posts
    126
    This all goes back to the basic principle of the internet:

    If you build it, they will hack it.

    Or, in this particular situation:

    If you try to stop them from hacking it, they will hack it.

    Borrrnnngggggg!

  18. #18
    Junior Member
    Join Date
    Dec 2000
    Posts
    2

    Is it just me....

    It seems Mr. Peter has protected his image....www.nrg.be
    The left+right click thingy didn't work, and when you press enter well it just goes to the next page, How would you get that thing? Not that i want to, i was just wondering from all you little Hackers round here...LOL
    ~Noah

  19. #19
    Senior Member
    Join Date
    Dec 2000
    Posts
    126
    I got the script that allows him to do that. Here it is. I can post it here, I think, because it is not NRG's property, but it's DynamicDrive's and it's free.

    I'd tell you how I got there, but that might be illegal or something. Let's just say I followed the Frame SRC's.

    Code:
    <*script language=JavaScript>
    <!--
    
    /*
    Disable right mouse click Script (By Crash @ http://walk.to/crash)
    Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive
    For full source code to this script and 100's more, visit 
    http://dynamicdrive.com
    */
    
    var message="Copyright ©2000 NRG Ltd. - All rights reserved.";
    function click(e) {
    if (document.all) {
    if (event.button==2||event.button==3) {
    alert(message);
    return false;
    }
    }
    if (document.layers) {
    if (e.which == 3) {
    alert(message);
    return false;
    }
    }
    }
    if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown=click;
    // --> 
    <*/script>
    Yes, folks, anybody can get code if they want it.

  20. #20
    VAlid Arguments all of you - but there are waysd around everything many of you suggested. First off - the script I posted works - I emplore you to try it yourself - now secondly, you can scare off many peons by simply creating a comment in the top of your HTML document and moving your code down about four screens. The average web user will not notice the scroolbar and will be deterred by the phony comment at the top. Make the comment say something stupid like "Protected by HTMl Enforcer, your IP address is being logged" - this sounds stupid to us, but to someone fairly new to the game, they will be shocked.

    As for a comment I heard about password protecting SWF movies - that is such a load! There are programs out there that can crack and even bypass such security measures.

    No SWF file is safe - your graphics - imported images, sounds effects and even actionscripts can be taken - so dont be so cocky about the safety of your work on the web. Because once you put it online - it's fair game...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center