www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: Disabling "View Source"

  1. #1
    Join Date
    Nov 2003
    Location
    Singapore
    Posts
    19

    Disabling "View Source"

    Hello, are there any scripts on the web that could disable visitors from viewing my web source code? (can java script do this? if not any recommendations?)

    Thank you
    Regards

  2. #2
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    Sorry, cannot be done. Search around this forum for a few in-depth debates.

  3. #3
    Join Date
    Nov 2002
    Location
    Nashua, NH
    Posts
    3,195

    Talking

    I have a recommendation: code your HTML so that you are not ashamed of it, 'cause other than that I can not think of a good reason to hide it
    Vladdy

    Working web site is not the one that looks the same in a few graphical browsers, but the one that adequately delivers its content to any device accessing it.

  4. #4
    Join Date
    May 2003
    Location
    Mordor
    Posts
    454
    OR code your HTML & javascript so that anyone would be ashamed of it. In that way you minimise the risk of it being ripped.

  5. #5
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    7
    I've actually seen some sites that don't allow the view code in the popup menus, I think they do it by using layers or iframes or something like that.

    Alternatevely, you could encode your javascript with a little Microsoft tool called Script Encoder, the Javascript will look all (%^&^%&*%^*^%&) like that, but be carefull, only IE can decode it on the fly, Netscape can't.

  6. #6
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    20

    hide source code

    You can buy a thingy that does it, so it must be possible!

    if you're willing to pay $50, have a look at
    http://www.WebLockPro.com

    Oh, and if you buy it, could you please share the secret?

    Cheers.

  7. #7
    Join Date
    May 2003
    Location
    Montreal, Québec, Canada
    Posts
    98
    if you look at the page (it is protected with the weblock software), you'll notice som php use, encryption, no right-click, and a lot of other script...

    But even this way the code is not 100% protected...

    It's a shame...
    Shall i be worship for what i am ?

  8. #8
    Join Date
    Nov 2003
    Location
    Singapore
    Posts
    19
    thanks many for the constructive suggestions...maybe can try the weblock prog...and Scientist, could you elaborate more on your method...i personnaly seen some sites that could lock you from copying anything from their web and also prohibit you from viewing their source code...im impressed.

    (by the way my source code has nothing to be ashamed of, im trying to do it in a more professional method)....

  9. #9
    Join Date
    Nov 2002
    Location
    Nashua, NH
    Posts
    3,195

    Re: hide source code

    Originally posted by CherryAA
    You can buy a thingy that does it, so it must be possible!

    if you're willing to pay $50, have a look at
    http://www.WebLockPro.com

    Oh, and if you buy it, could you please share the secret?

    Cheers.
    You are so gullible.
    WebLockPro is a scam that makes money off people's ignorance.

    I guess I will take my time and educate consumers:
    Here are the easy steps to get the http://www.weblockpro.com/home.php source for whatever it is worth:
    [list=1][*]Get Mozilla with Web Developer extension for easy bypass of no-right-click script and other silly stuff[*]Disable javascript after the page loads. View source and save it to an HTML file. Open the file in a text editor that allows word wrap.[*]Towards the end of the document you find some scrambled stuff - for further convinience delete everything up to the first "meta" tag.[*]Create a simple HTML document which you will use to get the code:
    Code:
    <html>
    <head>
    <title>testing</title>
    <script>
    function pageLoad()
    { document.getElementById('output').value = unescape(); 
    }
    </script>
    </head>
    <body onload="pageLoad()">
    <textarea id="output" rows="30" cols="80">
    </textarea>
    </body>
    </html>
    [*]Copy the first escape sequence from the weblockpro code and paste it into your unescape function like that:
    Code:
     unescape("%77%69%6E%/*More scrambled stuff*/%6C%3B");
    [*]Load your HTML page and see the descrambled code in the textarea. What you learn is that the regular document write function is disabled and it's code is mapped to _dw.[*]Unscramble the second escaped sequence from the weblockpro source and find the following code comments are mine
    Code:
    _d="";    //initialize string variable 
    for(_i=0;_i<_c.length;_i++)  // Go through all characters in string _c 
      if(_i%3==0)_d+="%";    //for every third character insert the % sign 
      else _d+=_c.charAt(_i);
    eval(unescape(_d));  //Unescape the resulting code and evaluate it 
    _d="";   //Set the _d variable to empty string so no one can get it 
    [*]Now to get the code, create the following function in your HTML document
    Code:
    function get_c()
      { _d='';
        for(_i=0;_i<_c.length;_i++) 
            if(_i%3==0)_d+="%";     
            else _d+=_c.charAt(_i);
        return unescape(_d);
      }
    modify your pageLoad function to put out the result of get_c()
    Code:
    function pageLoad()
    {  document.getElementById('output').value =get_c();
    }
    copy the _c string from the weblockpro source code to your HTML file and reload it[*]What you find is the following function again comments are mine
    Code:
    function _x(s)
     { s=unescape(s);  // Unescape the function string argument 
       t=Array();      // Define array 
       t[0]="";        // Set first element to empty string
       j=0;            // Initialie index variable
       for(i = 0; i < s.length; i++)  //iterate through the input string 
         { t[j]+=String.fromCharCode(s.charCodeAt(i) + (i%2==0 ? 1 :-1));  //Do the decoding 
           if((i+1)%300==0)  // Limit the length of the array elements to 300 
             { j++;          // (supposedly for better performance
               t[j]="";
             }
         }
       document.write=_dw;
       u="";
       for(i=0; i<t.length; i++)   // Combine the decoded strings into one      
         { u+=t[i];
         }
       document.write(u);   // Write it to the document
       u="";
       t=Array();
       _dw=document.write;
       document.write=null;
      }
    Once again change the function as follows:
    Code:
    function getCode(s)
     { s=unescape(s);
       t=Array();     
       t[0]="";      
       j=0;           
       for(i = 0; i < s.length; i++) 
         { t[j]+=String.fromCharCode(s.charCodeAt(i) + (i%2==0 ? 1 :-1)); 
           if((i+1)%300==0) 
             { j++;         
               t[j]="";
             }
         }
       u="";
       for(i=0; i<t.length; i++)      
         { u+=t[i];
         }
      return u;
      }
    add it to your HTML page, modify the pageLoad function to put out the unscrambled code and copy the scrambled page content string, which is found at the end of the weblockpro as an arguement to function _x(""), to a variable on your page which become the argument to your function getCode(s);[*]Reload your HTML document and see the code.[/list=1]

    Now, that the decoding function is known the process can be automated: www.vladdy.net/webunlockpro.html

    If you go through some of the pages from "testimonials" section, you will find HTML that is "protected" is such that anyone would be ashamed of
    Vladdy

    Working web site is not the one that looks the same in a few graphical browsers, but the one that adequately delivers its content to any device accessing it.

  10. #10
    Join Date
    Nov 2002
    Location
    Nashua, NH
    Posts
    3,195
    Originally posted by advinc
    thanks many for the constructive suggestions...maybe can try the weblock prog...and Scientist, could you elaborate more on your method...i personnaly seen some sites that could lock you from copying anything from their web and also prohibit you from viewing their source code...im impressed.

    (by the way my source code has nothing to be ashamed of, im trying to do it in a more professional method)....
    Yeah, when you are a kid watching a magician you get impressed as well. When a magician watches a magician, he knows what's going on or can easily deduce it.

    Any method which attempts to block the viewing of HTML source IS amature. If your code is nothing to be ashamed of, why do you want to hide it???
    Last edited by Vladdy; 11-28-2003 at 11:17 AM.
    Vladdy

    Working web site is not the one that looks the same in a few graphical browsers, but the one that adequately delivers its content to any device accessing it.

  11. #11
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    Bottom line, and everyone listen up now... you CANNOT protect anything that runs on the client machine. That includes HTML, JavaScript, and images. This is a fact that is inherent to how the World Wide Web works. If anyone tells you otherwise, they are either ignorant or a con.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  12. #12
    Join Date
    Nov 2002
    Posts
    204
    Well done Vladdy, and well said Jeff. A true profesional doesn't worry about going through all of these hoops.

  13. #13
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Did any of you read any of the WebLockPro site? It is complete BS...

    Under "Why you should try WebLockPro TODAY!"

    (Just picking out a few of my favorites - there are lots more)

    Lie 1: Automatically increases your traffic
    Last time I checked, making an inaccessible site does not drive the visitors up...

    Lie 2: 100% compatible with all web pages and browsers
    It relies on JavaScript... enough said.

    Lie 3: disabling right clicks, text selection, printing, caching, local viewing, and screenshots are just a few of WebLock Pro's features
    Anybody want a screenshot of the site? Or, a screenshot with my right-click menu open?

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  14. #14
    Join Date
    May 2005
    Posts
    6

    Lightbulb asp encrytion engine

    Hi,

    I'm a asp developer and I'm would like to encrypt some data that I pass trought the url.
    Does anybody know of any asp engine that will allow me to encrypt data.
    Thank you

  15. #15
    Join Date
    Sep 2005
    Posts
    72
    Quote Originally Posted by pyro
    Did any of you read any of the WebLockPro site? It is complete BS...

    [ snippage ]

    Lie 3: disabling right clicks, text selection, printing, caching, local viewing, and screenshots are just a few of WebLock Pro's features
    Anybody want a screenshot of the site? Or, a screenshot with my right-click menu open?
    BWAHAHAHAHAHAHAHAHAHA...

    Screenshots? SCREENSHOTS?! I mean, sure, the others are at least restricted by IE because IE is stupid, but screenshots?

    BWAHAHAHAHAHAHAHA...
    IE 6 renders Acid 2 like Opera 3.6. IE 7 renders Acid 2 like Opera 4. Firefox 1.5 renders Acid 2 like Opera 8. And Opera 9 renders Acid 2 correctly.
    Need I say more?

Thread Information

Users Browsing this Thread

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

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



Recent Articles