Click to See Complete Forum and Search --> : Disabling "View Source"


advinc
11-27-2003, 11:38 PM
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

fredmv
11-27-2003, 11:41 PM
Sorry, cannot be done. Search around this forum for a few in-depth debates.

Vladdy
11-28-2003, 06:42 AM
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 :D :D :D :D

Gollum
11-28-2003, 06:45 AM
:D OR code your HTML & javascript so that anyone would be ashamed of it. In that way you minimise the risk of it being ripped. :p

theSCIENTIST
11-28-2003, 06:54 AM
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.

CherryAA
11-28-2003, 08:29 AM
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.

cacalex
11-28-2003, 08:47 AM
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... ;) :p

advinc
11-28-2003, 10:02 AM
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)....

Vladdy
11-28-2003, 11:00 AM
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:

<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:
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

_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

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()

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

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:

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
11-28-2003, 11:08 AM
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???

Jeff Mott
11-28-2003, 12:43 PM
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.

James L.
11-28-2003, 12:53 PM
Well done Vladdy, and well said Jeff. A true profesional doesn't worry about going through all of these hoops.

pyro
11-28-2003, 05:14 PM
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?

Claudio
09-22-2005, 07:59 PM
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

Zarel
09-22-2005, 08:14 PM
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...

felgall
09-22-2005, 11:29 PM
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?


You left out the fact that a completely decrypted copy of the page source can be easily obtained in under 10 seconds using nothing but a web browser. The same is true of ANY web page of course as web browsers need to be able to decrypt the page in order to display it and it is simply a matter of accessing that decrypted source (eg. by selecting File | Save As in Netscape 7.0).

Anyone who spends money on any form of client side web page protection software has thrown their money away - not to mention chasing many of their potential visitors away.

jamez62
01-22-2006, 10:40 AM
do NOT waste your money buying this sh!ty program, it dosnt do what it says, and there is no money back garuntee. ive purchased this program alittle more then a year ago, i got a virus and had to redo my computer, when i tryed reinstall weblockpro, it said my receipt number was being used by another computer, and was terminated, ive wasted $50.00 on this program. the guy who is doing this needs to burn in hell for stealing peoples money. im so furious about him stealig my money i found out how to download weblock pro free from his own website, and it was by accedent!!! but you still need a receipt number. go here www.weblockpro.com/home.php
NOW delete "home" and type in "download.php"... and this program is supposed to protect information?? bullsh!t!!!!. :mad:

Kevey
01-22-2006, 10:51 AM
NOW delete "home" and type in "download.php"... and this program is supposed to protect information?? bullsh!t!!!!. :mad:

ROFLMAO - it does work just as you said...I wouldn't dream of stealing it, but wow. :D

FromU2ME
01-22-2006, 01:02 PM
Been there, done that (NOT), banned it for ever! :cool:

I really looooove these kind of sites... it's HAPPY HOUR!!! Damn - you can laugh for hours :D

seointexas
07-15-2010, 06:36 PM
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???

----------------------------


Have you ever thought that perhaps a web developer might have a client that does not want his code to be seen or copied? Whether you are proud or not of it, matters not. What the client wants matters.

"he who knows not and knows not that he knows not is a fool, shun him.
he who knows not and knows that he knows not is a scholar, teach him.
he who knows and knows that he knows is a teacher, follow him..." ;)

criterion9
07-15-2010, 10:06 PM
Have you ever thought that perhaps a web developer might have a client that does not want his code to be seen or copied?
In order for a browser to display it it must be downloaded to the browser. There is no real protection offered by "blocking view source".

Kor
07-16-2010, 02:43 AM
Have you ever thought that perhaps a web developer might have a client that does not want his code to be seen or copied? Whether you are proud or not of it, matters not. What the client wants matters.
The client usually wants many things, but even the Mighty Client can not want what is impossible. There is absolutely no reasonable way to hide the client-side languages codes, nor to prevent the images or text copying.

Declan1991
07-16-2010, 05:33 AM
Have you ever thought that perhaps a web developer might have a client that does not want his code to be seen or copied? Whether you are proud or not of it, matters not. What the client wants matters.

Besides the fact that it's impossible in any reasonable manner, what did you hope to achieve by contradicting him seven years after he made his comments?

6StringGeek
07-16-2010, 08:46 AM
Curious why someone would want to hide their code...what benefit do they get from it...none that I know of.

Is it to hide their SEO work? Stop hiding...you can't hide. There are too many smart people out there. Of course you will deter the average visitor, but it's not the average visitor that wants to see your source.