View Full Version : block source - frames, js, html


Douglas
09-06-2005, 02:21 PM
i dont no if this is already in here so delete it if it is,

this will show you how to block your document source using -

html
frames
javascript

remember there are ways around it,

ok first make a page called page.html


<html>

<head>
<title>Title</title>
</head>

<frameset rows="1,*" frameborder="0" framespacing="0">
<frame src="about:blank" name="frame2" noresize>
<frame src="realpage.html" name="frame1" noresize>
</frameset>

<body>
</body>

</html>


this makes it so if the user clicks 'View Source' or 'Document Source' etc, they will see frame code :)

now make the file named realpage.html (this is the file they will be viewing, it must contain the no right click script):


<html>

<head>
<script language="JavaScript1.2" type="text/javascript">
// This script and others available free at http://www.lissaexplains.com
if (window.Event)
document.captureEvents(Event.MOUSEUP);

function nocontextmenu() {
event.cancelBubble = true, event.returnValue = false;

return false;
}

function norightclick(e) {
if (window.Event) {
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;
}
}

if (document.layers)
document.captureEvents(Event.MOUSEDOWN);

document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
document.onmouseup = norightclick;
//--></script>
</head>

<body onload="if (top == self) { window.location='page.html'; }">

Blah Blah Blah

</body>

</html>


the

<body onload="if (top == self) { window.location='page.html'; }">

will redirect the realpage.html to page.html if there are no frames on the page

the no right click script will make sure if anyone right clicks in that frame on the page.html page it will block it

i hope this helps :D:D:D