Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: How to stop viewing the Source code?

  1. #1
    Join Date
    Dec 2011

    How to stop viewing the Source code?

    Hi ,
    Can anyone suggest me the code for to stop viewing the source code(No Right Click/Stop People From Viewing Source Code ) for any type of browsers developed in any technology.


  2. #2
    Join Date
    Dec 2003
    Bucharest, ROMANIA

  3. #3
    Join Date
    Jan 2004
    chertsey, a small town s.w. of london, england.
    Hi there manoj2662,

    why on Earth would you want to stop people from viewing source code.

    Stupid desires like that, suggest to me that you are suffering from megalomania.

    See a doctor before it gets out of hand.

    Last edited by coothead; 12-08-2011 at 10:48 AM.

  4. #4
    Join Date
    Dec 2011

    Reg: Source Code?

    Hello Buddy...
    I Don't wanna hide anything from the world but just wanna know that the code for it...if itz possible plz let me know orelse thanks for the reply to my post...

  5. #5
    Join Date
    Mar 2011
    As the others have said above, it is impossible to hide the HTML from users. You can do some things in JavaScript to make it a little complicated for them to see your code, but eventually you have to give the browser access to the real code so it can render the page. And anything a browser can decipher, a user can too.

    Don't waste any time or effort on this. It's not worth it.
    Rick Trethewey
    Rainbo Design

  6. #6
    Join Date
    Dec 2011
    Right Click close on the web page you can use below mention script

    <SCRIPT language=JavaScript>
    var message = "function disabled";
    function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
    document.onmousedown = rtclickcheck;

  7. #7
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    Quote Originally Posted by mtrick View Post
    Right Click close on the web page you can use below mention script

    <SCRIPT language=JavaScript>
    var message = "function disabled";
    function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
    document.onmousedown = rtclickcheck;
    Please, stop giving false solutions. Once for ever: you can not hide the client-side code.

  8. #8
    Join Date
    Dec 2011

    thanks bro...

    thanks bro for that java script......

  9. #9
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    Quote Originally Posted by manoj2662 View Post
    thanks bro for that java script......
    When you will implement that in your site, let me know the url, so that I will enter your site, copy all your codes and I will send them back to you by e-mail.

  10. #10
    Join Date
    Nov 2010
    Hi. Every web-browser downloads the complete source of your page, and regardless of whether you disable right click or not, the user can save a copy of this code, or view the source from the menus in any mainstream browser, no plugins or special knowledge required.

    Even if browsers didn't allow this, a novice programmer could write a program in less than 3 lines of code to download and save the source of your page, all they have to know is the address.

    If you want you could try making the code hard to understand. There are minifiers and obfuscaters for javascript (which shrink your code or make it hard to read).

    You can also put most of the program logic on the server side so that people can read the output you send them (ie the pages), but not how your web application works (ie how decisions are made and page content is generated).

    What is your purpose in trying to hide your code? If you explain that then maybe there are other ways to achieve what you want.

  11. #11
    Join Date
    Dec 2011
    Agree with "Interfacetricks" there is no way to hide the code. With right click disable only beginners or someone who doesn't have much knowledge can be kept away from the code and if someone knows a bit about the code they will also know that in case right click is disabled they can go to File..>Save as menu and save the code locally then view the code. Then there are many applications that can save the complete site with all the css and images.
    Client side code cannot be hidden.

  12. #12
    Join Date
    Dec 2011
    If you can view a website in a browser, then there isn't a way to hide source code.

    If you don't want someone to see your source code - don't write it
    Did you do your website html homework today? make french toast bora Stanley Kubrick's 2001 dvd kubrick on DVD.

  13. #13
    Join Date
    Jul 2012
    var message="Function Disabled!";
    function clickIE4(){ if (event.button==2){ alert(message); return false; } }
    function clickNS4(e){ if (document.layers||document.getElementById&&!document.all)
    { if (e.which==2||e.which==3){ alert(message); return false; } } }
    if (document.layers){ document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById)
    { document.onmousedown=clickIE4; }
    document.oncontextmenu=new Function("alert(message);return false")

  14. #14
    Join Date
    Mar 2012
    Interfacetricks is right, the only way to hide your logic is to put it server-side using PHP or such like. But if your site is simple HTML/CSS there is no way to hide it. The browser has to be able to read the client-side code, so a user can as well. Using scripts to disable functions just pisses off the users. Forget it!

    P.S. Read the sticky at the head of this forum!!!
    Last edited by jedaisoul; 07-14-2012 at 06:01 AM.

  15. #15
    Join Date
    Oct 2013

    Hiding or Protecting a Source Code

    Hi Guys, I am new here, but have been in the IT game for more years than you would like to think of.
    In answer to those wishing to hide the source code, let me tell you that it is not possible, no matter what kind of scripts you may use,
    as there is always a work-around method of viewing the source.
    One can encrypt the source, and someone smart comes along and decrypts it.
    The encryption/decription is freely available on the internet.
    Now, just to give you a typical example of websites that you actually cannot view the source.
    All one has to do is copy the address shown in the address bar and download it with a download manager.
    If the source was written in PHP, not a problem, as after you have saved it to your directory, you will notice it
    as video.php or whatever.php. Just rename the .php to .htm or .html, makes not much odds.
    Once done, just double click on the change you have made and the source becomes visible.
    If the visible source is encrypted, then just use the internet to decrypt it.

    That's it guys ..... believe me it works.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13843 seconds
  • Memory Usage 3,017KB
  • Queries Executed 15 (?)
More Information
Template Usage (36):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (75):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates