You
Are Here: Home
> Resource
Articles > Stealth
& Security > Article

|
Untitled Document
Top
Picks for
Wednesday, 20 Aug 2008
|
How
To Disable 'Copy And Paste' To Protect Your Source Code And Images
by
Nelson Tan
"No
Right Click" JavaScript For Images
Have
you ever worked really hard on graphics for your site only to
find later that someone has stolen them as their own. You can
fully encrypt and protect your site with HTML-Protector
and the scripts below will help against novices.
Use
the script below so when someone right clicks to save an image
off your page, a message will come up letting people know that
your information is copyrighted.
This
script only works on newer browsers, and it's not foolproof. If
someone really wants something from your page they can find ways
around it, but at least it's a warning to people who want to take
your graphics. Copy and paste the following code, and make sure
it comes right after your <HEAD> tag:
<script
language="JavaScript">
// distributed by http://hypergurl.com
<!--
var popup="Sorry, right-click is disabled.\n\nThis Site Copyright
©2000";
function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=noway;
// --> </script>
"No
Right Click" JavaScript For Source
Here
is a handy little script which will not only protect your images
from right clicking, but your whole page. Remember this only stops
some visitors from viewing your source. There are ways around
it and if someone really wants to view your source they may find
a way. There is another trick below to protect your source code.
This
script works best if placed within the head tags of your html.
Homestead users can use the "insert html" option within
their editors:
s<script
language="JavaScript1.1">
// distributed by http://www,hypergurl.com
<!-- var debug = true;
function right(e)
{
if (navigator.appName == 'Netscape' && (e.which == 3 ||
e.which == 2)) return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert('This Page is fully protected!');
return false;
}
return
true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
//--></script>
Disable
"Copy And Paste"
One
of the most popular security questions is "How do you stop
visitors from stealing your webpage information?"
Below
is a little trick that will stop your visitors from copying and
pasting your web page information. Anyone with experience may
know a way around this trick. However it will make it hard enough
to discourage them and get them moving on to easier targets.
Add
the following HTML code to your BODY tag and this is what it looks
like once implimented: <body bgcolor="#FFFFFF" ondragstart="return
false" onselectstart="return false">
Make
Your Source Code Vanish!
Now
before I show you this last trick to protect your source, I would
like you to first view my source. Just click "View"
then choose "Source".
How
did I do that?
Place
your cursor in front of the opening <html> tag and hit your
enter button for a while. It will push your source code out of
view and this will fool the fools. *smiles*.
These
are rather simple yet effective tricks for webmasters of all levels
to implement even a 'sense' of security for their own site protection.
However, when you are prepared to invest in a more powerful software,
we recommend HTML-Protector
for its ability to prevent e-mail address extraction, password-protect
your web pages, encrypt links (especially order links!), disable
screen-capture and many more!
For
further information, click here
to visit the Features and FAQ sections.
Nelson
Tan is one-half of the Internet
Mastery Center. Create Your Online Profits with the RIGHT
Products, Environment and Mindset!

| Hot
Recommendations |
 |
|
| Internet
Mastery Center Blog |
|
|