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.
 
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.
 
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.
 
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.
 
yeah those crappy no right click messages are a pain when scrolling with mouse wheel/ open new tab
 
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.
 
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
 
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

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
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.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back