Reply
Old May 14th, 2003 Top | #1
jake123456789
 
jake123456789's Avatar
Unregistered
Posts: n/a

Question prevent user to "view Source" from Internet Explorer

I want Java source code to prevent internet explorer user click on second mouse and view resource.

Can Someone email to me pls or post it over!

Thanks you!
  Reply With Quote
Old May 14th, 2003 Top | #2
Herkalees
 
Herkalees's Avatar
Unregistered
Posts: n/a

Default

This disables right-click entirely.


PUt this in the body tag…


<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>
  Reply With Quote
Old May 14th, 2003 Top | #3
 
yoyo's Avatar
_________________
Joined: July 2002
Posts: 1,557
Reputation: 160
Power: 136

Default

..and do you think someone interested in your source code doesn't know how to disable javascript?
yoyo is offline   Reply With Quote
Old May 14th, 2003 Top | #4
drahzar
 
drahzar's Avatar
Unregistered
Posts: n/a

Default

they can always just go to view source in the menu
  Reply With Quote
Old May 14th, 2003 Top | #5
 
SPeedY_B's Avatar
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 310

Default

Heh, I was going to write what yoyo and drahzar have posted above me.

It is, absolutely, 100%, impossible to hide your source code.
Because basically, that source gets sent to the browser, without it there's is nothing to render, and once your source is at the user end there are multple ways of viewing it.

For example, turn javascript off, use a different browser, put the URL into a download manager then open it with notepad, put the URL into the open dialog of something like frontpage, find the cached version of the page and open it up, and so on.
SPeedY_B is offline   Reply With Quote
Old May 14th, 2003 Top | #6
 
sboulema's Avatar
OSNN Veteran Addict
Joined: June 2002
Location: Amstelveen, The Netherlands
Posts: 2,846
Reputation: 120
Power: 151

Default

why do you website makers are so pinned on protecting our sourcecode. i find it very annoying when sites do that cause i cant use my mouse gestures on that kinda sites
sboulema is offline   Reply With Quote
Old May 22nd, 2003 Top | #7
 
X-Istence's Avatar
*
Joined: December 2001
Location: USA
Posts: 6,496
Reputation: 2808
Power: 220

Default

I hate it as well, if someone wants to rip my sites source they can do so if they wish. Ill just kill them if i find my desing on another site.

Mozilla still pops the window up even if that message comes so right click still works .
X-Istence is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Lagged" Responses from Internet Explorer Supratik Windows Desktop Systems 8 August 7th, 2002 8:35am
Anyone know of a good "filter" aka sniffer to prevent DOS attacks? XeoNoX Windows Desktop Systems 11 June 3rd, 2002 10:50am
"View>Thumbnails" keeps going back to "Detailed" view in My Pictures folder Armed and DWI Windows Desktop Systems 5 May 13th, 2002 7:53pm
How do I set up "default user" or "Automatic login" in XP (like in Win95/98/2000 eka Windows Desktop Systems 3 February 7th, 2002 7:41pm
How do you get rid of the "Links" folder for internet explorer in favorites? Punkrulz Windows Desktop Systems 17 December 30th, 2001 9:39am