prevent user to "view Source" from Internet Explorer

Discussion in 'Windows Desktop Systems' started by jake123456789, May 14, 2003.

  1. I want Java source code to prevent internet explorer user click on second mouse and view resource.

    Can Someone email to me pls or post it over!

    Thanks you!
  2. Herkalees

    Herkalees Guest

    This disables right-click entirely.

    PUt this in the body tag…

    <script language=JavaScript>

    //Disable right mouse click Script
    //By Maximus ( w/ mods by DynamicDrive
    //For full source code, visit

    var message="Function Disabled!";

    function clickIE4(){
    if (event.button==2){
    return false;

    function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
    return false;

    if (document.layers){
    else if (document.all&&!document.getElementById){

    document.oncontextmenu=new Function("alert(message);return false")

    // -->
  3. yoyo

    yoyo _________________

    ..and do you think someone interested in your source code doesn't know how to disable javascript?:p
  4. drahzar

    drahzar Guest

    they can always just go to view source in the menu
  5. SPeedY_B

    SPeedY_B I may actually be insane.

    Midlands, England
    Heh, I was going to write what yoyo and drahzar have posted above me.

    It is, absolutely, 100%, impossible to hide your source code.
    Because basically, that source gets sent to the browser, without it there's is nothing to render, and once your source is at the user end there are multple ways of viewing it.

    For example, turn javascript off, use a different browser, put the URL into a download manager then open it with notepad, put the URL into the open dialog of something like frontpage, find the cached version of the page and open it up, and so on.
  6. sboulema

    sboulema Moderator

    Amstelveen, The Netherlands
    why do you website makers are so pinned on protecting our sourcecode. i find it very annoying when sites do that cause i cant use my mouse gestures on that kinda sites
  7. X-Istence

    X-Istence * Political User

    I hate it as well, if someone wants to rip my sites source they can do so if they wish. Ill just kill them if i find my desing on another site.

    Mozilla still pops the window up even if that message comes so right click still works ;).