Stopping 'View Source'

Would it be possible to stop the 'view source' tool being clicked in IE. If so please can you give me the code for it. Many thanks ITA.

Comments

  • [b][red]This message was edited by Thanatos at 2002-8-10 14:13:33[/red][/b][hr]
    You can't disable the view source using javascript, but you can use external scripts to hide your code, you can do it with Javascript code, but I forgot how to do it with HTML.
    Homepage: http://www.thanatos.vze.com



  • : Would it be possible to stop the 'view source' tool being clicked in IE. If so please can you give me the code for it. Many thanks ITA.
    :
    :
    http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=1598
    There you will find a rather complicated script that will
    successfully hide your source code. good luck.
    suchaputz



  • : : Would it be possible to stop the 'view source' tool being clicked in IE. If so please can you give me the code for it. Many thanks ITA.
    : :
    : :
    : http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=1598
    : There you will find a rather complicated script that will
    : successfully hide your source code. good luck.
    : suchaputz
    :
    :
    :
    : First thing is you have to create a floater window and say 'toolbar=no' when you create the window. That way they can't click on the 'View button, then view source' Second here is some code to disable the right click mouse button that way they cant right click and view source. Hope this helps

    function disable_right_click(e)
    {
    var browser = navigator.appName.substring ( 0, 9 );
    var event_number = 0;
    if (browser=="Microsoft")
    event_number = event.button;
    else if (browser=="Netscape")
    event_number = e.which;

    if ( event_number==2 || event_number==3 )
    {
    alert ("Right Mouse Button Is Disabled");
    return (false);
    }

    return (true);
    }




    function check_mousekey ()
    {
    var mouse_key = 93;
    var keycode = event.keyCode;

    if ( keycode == mouse_key )
    alert ( "Mouse Key Is Disabled" );
    }

    function trap_page_mouse_key_events ()
    {
    var browser = navigator.appName.substring ( 0, 9 );

    document.onmousedown = disable_right_click;

    if ( browser == "Microsoft" )
    document.onkeydown = check_mousekey;
    else if ( browser == "Netscape" )
    document.captureEvents( Event.MOUSEDOWN );
    }

    window.onload = trap_page_mouse_key_events;



  • : : : Would it be possible to stop the 'view source' tool being clicked in IE. If so please can you give me the code for it. Many thanks ITA.
    : : :
    : : :
    : : http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=1598
    : : There you will find a rather complicated script that will
    : : successfully hide your source code. good luck.
    : : suchaputz
    : :
    : :
    : :
    : : First thing is you have to create a floater window and say 'toolbar=no' when you create the window. That way they can't click on the 'View button, then view source' Second here is some code to disable the right click mouse button that way they cant right click and view source. Hope this helps
    :
    : function disable_right_click(e)
    : {
    : var browser = navigator.appName.substring ( 0, 9 );
    : var event_number = 0;
    : if (browser=="Microsoft")
    : event_number = event.button;
    : else if (browser=="Netscape")
    : event_number = e.which;
    :
    : if ( event_number==2 || event_number==3 )
    : {
    : alert ("Right Mouse Button Is Disabled");
    : return (false);
    : }
    :
    : return (true);
    : }
    :
    :
    :
    :
    : function check_mousekey ()
    : {
    : var mouse_key = 93;
    : var keycode = event.keyCode;
    :
    : if ( keycode == mouse_key )
    : alert ( "Mouse Key Is Disabled" );
    : }
    :
    : function trap_page_mouse_key_events ()
    : {
    : var browser = navigator.appName.substring ( 0, 9 );
    :
    : document.onmousedown = disable_right_click;
    :
    : if ( browser == "Microsoft" )
    : document.onkeydown = check_mousekey;
    : else if ( browser == "Netscape" )
    : document.captureEvents( Event.MOUSEDOWN );
    : }
    :
    : window.onload = trap_page_mouse_key_events;
    :
    :
    :
    :

    Hi there,

    It's impossible to completely hide your source. Even the disabling of the right mouse click can be circumvented by clicking the View Menu then Source.

    Microsoft has a compiler that allows you to compile JavaScript into a binary format and when read in by IE, it'll decompile it and execute it but leave the source in it's compiled state, effectively hiding your source.

    BUT...this is a Mircosoft ONLY product! If you can live with that (as everyone should IMHO q:))) ), then you've got no problems!

    HTH
    Bradley q:)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories