Source Scripts

L

Lee

Guest
I am looking for some code to prevent the use of ''view source'' in tool bars of all browsers.

I wrote something for preventing direct copying, from right/left clicking images.

I wonder also if it works with applications like internet booster to stop them copying my sites.
 

Henyman

Secret Goat Fetish
Political Access
Joined
9 Jun 2002
Messages
9,606
cant be done, no matter what you try i will be able to see the source by using firefox etc or by opening it with dreamweaver etc from my temp files.
 

Xie

- geek -
Joined
29 Sep 2003
Messages
5,274
Like Heny said .. can't be totally stopped and trying to do so only makes your site annoying and drives ppl away .. I know I don't visit more then once any site w/ all that anti-right lick and blah blah blah.
 

SPeedY_B

I may actually be insane.
Joined
31 Mar 2002
Messages
15,804
Absolutely 100% impossible. At the end of the day, your source gets sent to the browser, therefore it can be extracted no matter what you do, even if the user has to go to the extremes of capturing the packets in-between server and browser.. it's doable.

And blocking the use of right-clicking should be punishable by biro in the eye. There are many reasons for legit right clicking, viewing properties of the page, wanting to copy some text, wanting to open a new tab (sometimes the third button is picked up as a right click too) and so forth.

So yeah, it's not possible, and the pointless methods, which only usually work in IE, will basically drive visitors away.
 

Henyman

Secret Goat Fetish
Political Access
Joined
9 Jun 2002
Messages
9,606
yeah those crappy no right click messages are a pain when scrolling with mouse wheel/ open new tab
 

SPeedY_B

I may actually be insane.
Joined
31 Mar 2002
Messages
15,804
Not to mention that some browsers simply have View -> Source from the menu, and that images can simply be left-click->dragged off the page.
 

Khayman

I'm sorry Hal...
Political Access
Joined
6 Jan 2002
Messages
5,518
Also if you want to copy an image you can always just screen cap the page, so disabling clicking. doesn't work.
In short, as others have said, if people really want your code/pictures theres nothing you can do. You can only stop not very clever people and annoy eveyone else
 
L

Lee

Guest
Henyman said:
yeah those crappy no right click messages are a pain when scrolling with mouse wheel/ open new tab

My script don't display any message, just does nothing.

If you click a link here to something that's been uplaoded a picture, when trying to view source from view it's greyed out, this is why asked.


I will put in my prevention script I got and you can see.

<script>
if (window.Event) // Only Netscape will have the CAPITAL E.
document.captureEvents(Event.MOUSEUP); // catch the mouse up event

function nocontextmenu() // this function only applies to IE4, ignored otherwise.
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e) // This function is used by all others
{
if (window.Event) // again, IE or NAV?
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}

}

document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
</script>

Or maybe you would like to see what I used years ago, which i undertood to be lame.

<SCRIPT language=Javascript1.2>

var mymessage = "Function not allowed. Get your own links and Images.";

function rtclickcheck(keyp){
if (navigator.appName == "Netscape" && keyp.which == 3) {
alert(mymessage);
return false;
}


if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
alert(mymessage);
return false;
}
}

document.onmousedown = rtclickcheck

</SCRIPT>
 

Members online

No members online now.

Latest profile posts

Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Threads
61,997
Messages
673,411
Members
5,589
Latest member
EmilyFox