help: Is there such a script available?

They have: 4 posts

Joined: Dec 1999

Hello, all

Is there any script which can keep webpage source code from being copied and/or being viewed by visitors? If yes, would you pls tell me how to find it?

Your help is highly appreciated:-)

They have: 5,633 posts

Joined: Jan 1970

Seems like this question is asked a lot here. The most straightforward answer is no. When you place a document on a web site, whether it’s HTML, images, sounds, videos, or text files it is not safe from “copying”.

When someone views a web site “all” the files required by that page are downloaded to the viewers hard drive. Where they are placed in a temp folder. Even if there was a way for you to block your visitors from viewing your source they can go into their temp and take all your files.

You can use a lame JavaScript code to prevent people from right clicking your page and selecting “view source” or “save image as”, but they can still select “view source” from their menu bar or even “save”.

If you have documents that you do not want people to copy, don’t place them on the web.

Server side scripting languages are different. They can “normally” not be downloaded as a whole.

------------------
Adam
AIS Internet Solutions
[email protected]

They have: 359 posts

Joined: Mar 1999

Course you can use NetScape and right click in the tigtag page and guess what, view frame source. I think IE is the only browser you can disable the right mouse click.

All a right click script is going to do is eliminate the casual viewer who probably doesn't know what he/she is doing anyway.

The experienced "webmaster" is going to know how to get around it.

Like Adam said, "If you have documents that you do not want people to copy, don’t place them on the web."

------------------
Dan
CDS Web Design

Dan
Recycle Video Games Network

Stupidity killed the cat, curiosity was framed!

They have: 24 posts

Joined: May 1999

Wat do you mean by Server Side scripting?

They have: 4 posts

Joined: Dec 1999

Adam,

Thanks for reply. Could you pls tell me which Server side scripting language you refered? Also, please check below website, their html source code seems very well protected. Any idea on which script language they use? http://tigtag.szptt.net.cn/
Thank you in advance.

They have: 5,633 posts

Joined: Jan 1970

By server side I mean Perl, PHP, ASP etc. The visitor sees the HTML part but not the program.

On the http://tigtag.szptt.net.cn/ site, I clicked in IE 5 "view" > "source" and saw the source. When you right click in IE5 I get a had to favorites box.

------------------
Adam
AIS Internet Solutions
[email protected]

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

There IS a way to protect the source of your site. (except your startpage) The way I do it is inspired by the functions on www.dynamicdrive.com

this is how you do it:

On startpage make 'links' to the rest of your site like this:

<img src="utellme" onclick="fullwin()">

The JS-function fullwin() looks like this

{
window.open("yourpage.htm","","fullscreen,scrollbars")
}

On 'yourpage.html' you will see only the page and nothing of the browser.
But there's always the rightmouseclick, that can make you see the source.
Simply use this script to disable that:

<script language="JavaScript1.2">

/*
Disable right mouse click Script
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
This script last updated:99/04/05
*/

if (document.all)
document.body.onmousedown=new Function("if (event.button==2| |event.button==3)alert('The right mouse button has been disabled')")

</script>

Now the visitor of your site MUST use the navigation-functions you created and cannot see anything of the code. But how do you get back in 'normal' mode?
This can be done by using ALT+F4
but easier is putting an image on the page like this:
<img src"utellmeagain" onclick="exit()">

the JS-exit function looks like this:
{
parent.close()
}

Now the user is back on your startpage and can browse to other sites (i.e. [url=http://www.webmaster-forums.com)]www.webmaster-forums.com)[/url]

That's All!

Shakespeare: onclick || !(onclick)

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

If someone uses an offline browser which downloads linked files or knows how to browse their cache files they could still get the code. Also, you could use the "Save target As" feature on a link in the main page.

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

you're right john,

but I found out another way to get the source, even if you use the script above.

try hitting SHIFT+F10 en you get your
'rightmouseclick-menu' in the upper left corner of your screen.

The Shift and the F10 key are not to be disabled as they don't give any output.

But hey, the code above looks great, doesn't it?

Shakespeare: onclick || !(onclick)

They have: 141 posts

Joined: Aug 1999

I hate the ani right mouse click code...

I think I have said this before, but when I surf, I open multiple windows, not being able to right click -> Open Link in new window, to be brutally honest 'pisses me off' this code not only makes pages longer to download and annoying, but tacky and unproffesional at best.

I have never seen a decent page that has used that code.

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

They have: 5,633 posts

Joined: Jan 1970

I agree mainly Randall.

If they do use it, It just makes me wonder what's there they don't want me to see. So I ALWAYS view the source. LOL

------------------
Adam
AIS Internet Solutions
[email protected]

They have: 5,633 posts

Joined: Jan 1970

Thanks for the SHIFT - F10 tip.

------------------
http://go.to/hass

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

you're welcome

------------------
Jack Michaelson
[email protected]

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

For the people who do not like the disable-right-mouse-click-script:
I do not like it either, on internet.
I only use it on an Intranet, that I'm developing at the moment.
The users of this intranet are all newbies to computers. The director of the company said that if I did not disable a lot (IE navbar and right-mouseclick) the employees would get confused.
That's why I use it.

------------------
Jack Michaelson
[email protected]

Shakespeare: onclick || !(onclick)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.