Quick Search for:  in language:    
11500,Makes,kind,hard,source,from,pageThis,co
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 220,465. lines
 Jobs: 92. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login





Latest Code Ticker for Java/ Javascript.
Click here to see a screenshot of this code!vok - The vocabulary trainer
By Thorsten Stärk on 1/7

(Screen Shot)

Java, Calculator
By Rockwell on 1/4


Eatable Interface
By Rockwell on 1/4


Superclass Person
By Rockwell on 1/4


Draws Cube Function
By Rockwell on 1/4


Rectangle Class
By Rockwell on 1/4


Find Number of Upper and Lower Case Letters in a Command Line Argument String
By Rockwell on 1/4


anagrams
By Rockwell on 1/4


Text Reader with Tokenizer
By Rockwell on 1/4


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Fool Proof No View Source Script

Print
Email
 
VB icon
Submitted on: 1/26/2000
By: Zilver Ztream  
Level: Beginner
User Rating: By 4 Users
Compatibility:JavaScript

Users have accessed this code 29605 times.
 
 
     Makes it kind of hard to get the source from a page. This code has been on javascripts.com for a while and I won code of the month ince with it, but I also recived over 11500 mails becuase of it so I hope that wont be needed here.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

//**************************************
//     
// Name: Fool Proof No View Source Scrip
//     t
// Description:Makes it kind of hard to 
//     get the source from a page.
this code has been on javascripts.com for a while and I won code of the month ince with it, but I also recived over 11500 mails becuase of it so I hope that wont be needed here.
// By: Zilver Ztream
//
//This code is copyrighted and has// limited warranties.Please see http://
//     www.Planet-Source-Code.com/vb/scripts/Sh
//     owCode.asp?txtCodeId=1745&lngWId;=2//for details.//**************************************
//     

Add this line to/ instead of your body tag:
(In a standalone HTML file before your protected page)
<BODY bgcolor=black onload="window.open('fullproof.htm','','halfscreen,scrollbars')">
ADD this script at the bottom of your page, just before your </BODY> tag.
(in the page you want to protect)
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
var message="ENTER YOUR CUSTOM MESSAGE HERE";
    function click(e) {
        if (document.all) {
            if (event.button == 2) {
            alert(message);
            return false;
        }

}
if (document.layers) { if (e.which == 3) { alert(message); return false; }
}
}
if (document.layers) { document.captureEvents(Event.MOUSEDOWN); }
document.onmousedown=click; // --> </SCRIPT>

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
2/27/2000 12:09:06 AM:Joseph Then
Yes, this is the code that will somehow 
prevent people to right-click and copy 
the source code.
However, do 
remember that there is a view source 
command in IE and NS. Thus this method 
is still rendered useless.
But, the 
workaround is to put all the code into 
a frame, that will make the view even 
more fool-proof. :> 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/6/2000 8:59:06 PM:iNfO
Hello, well, for IE, you can clic 
View>>Source , or on your keyboard, 
click on the button bottom button 
between then windows and control 
button, it will show you the menu, then 
you cna view the source, if ANYONE 
knows how to prevent these, please 
e-mail me, HandleisiNfO@cs.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/22/2000 6:06:55 PM:PaC
nothing is view source proof. if you 
ever programming with sockets in any 
language its real easy to get source 
code of page. people need to just 
realise if you dont want things stolen, 
dont publish. i for one hate thiefs, 
but thiefs will be thiefs
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/22/2000 11:09:15 PM:Michael
For a web page to be displayed on the 
users computer, a copy of it first 
needs to be downloaded to it. By 
default, these are stored in the 
Temporary Internet Files Folder, and 
can be accessed on or offline with 
ease. In this folder is a copy of all 
pictures, source code, js files and 
HTML files. There is nothing you can do 
to prevent this. Again, all prevent 
right click scripts have a limit on 
them: when right-clicking, hold the 
right button whilst the alert comes up, 
press ENTER or the space bar to clear 
the alert, then release the right 
button, voila! source code! But the 
above method is about as hard as you 
can make it..but it will only stop the 
kind of people who aren't interested in 
source code anyway.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/29/2000 2:26:24 PM:The VeNd
Love the code, do you have code to 
block view source in Netscape as 
well?
-vendimaan@yahoo.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/30/2000 12:08:18 PM:SORD
You could get a HTML stealer and view 
it easily...even in a frame because 
then you get the web page's address to 
the main page. You can't hide source 
code, there will always be someone able 
to get it. The only other way is to 
find someway to encrypt the page but 
still be able to load it. This will 
also just slow people down but people 
that aren't extremely smart wouldn't be 
able to get the source.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/8/2001 6:41:56 PM:Robert
Also you can view source of the 
STANDALONE PAGE to get the name of the 
PROTECTED PAGE to put in replace of the 
STANDALONE PAGE to bring up the 
PROTECTED PAGE in the window of the 
STANDALONE PAGE to view source of the 
PROTECTED PAGE. Or maybe, just write 
your own d**n code. (Steal Code from 
others as you would have them steal 
code from you.)...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/17/2001 9:47:16 AM:Jonathon Cebula
This is not fool proof, so why call it 
fool proof, I'm pretty sure a fool 
could find a way around it. There is 
much better methods, have a look at 
them on this site.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/1/2001 2:37:05 PM:Lara
I found a sight where, right clicking 
is allowed, but when you open their 
view source (by right click or by going 
to the brower menu View then choosing 
source), a .txt opens with their chosen 
copyright message. And even after I 
saved their site onto my pc and went 
through every bit of it, I could not 
find the code they used to do it. 
Anyone know what I'm talking about?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/28/2002 12:11:11 PM:|)/-\r/<$!|)3
/-/3~/_!_/-\(\/)_/\/0-|-_/-\_1~00l_/-\11
_!_|)0_!$_|)!$/-\|313_(//-\\//~\_$<7!|0-
|-_!/\/_!/\/-|-3r/\/3-|-_><|01073r
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/7/2002 9:13:41 PM:noize
Well they say it is fool proof... how 
likely is that?  Just like they said 
the titanic couldn't since, this script 
is nothing more then something for a 
source stealer to laugh at all day 
long.  Well I guess I will get to the 
point of why it isn't fool proof... yes 
it prevents people from right clicking 
but it suppose to protect the source.  
You can easily click both mouse buttons 
at the same time in IE and get the 
right pop up menu... well guys never 
believe anyone in the future when they 
tell you something is fool proof.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/2/2002 11:47:46 PM:
to view the source of any page just put 
the prefix view-source: in front of the 
page. for example, if i wanted to view 
the source of yahoo's site i would put 
in the address bar 
view-source:http://www.yahoo.com and 
the source pops rite up. just a neat 
little hacker trick i picked up along 
the way
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/23/2002 2:41:10 PM:
You CAN access the source code...  All 
you have to do is hold the LEFT mouse 
button and press the RIGHT button...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/7/2003 3:29:30 PM:MrEnigma
http://summerholiday.org/freecode/Right_
Click_-_Context_Sensitive_Menu(with_no_V
iew_Source_or_Save_Image_As).html
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/5/2003 2:44:11 AM:
You can also click the right button 
then enter in sequence till the menu 
pops up,its easier to just to click the 
right button then left together.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.