README.md

December 4, 2022 ยท View on GitHub

Fool Proof No View Source Script

Description

Makes it kind of hard to get the source from a page.

This code has been on javascripts.com for a while and I won code of the month ince with it, but I also recived over 11500 mails becuase of it so I hope that wont be needed here.

More Info

Submitted On
ByZilver Ztream
LevelBeginner
User Rating1.5 (6 globes from 4 users)
Compatibility
CategorySecurity
WorldJava
Archive File

Source Code

Add this line to/ instead of your body tag:
(In a standalone HTML file before your protected page)
<body bgcolor=black onload="window.open('fullproof.htm','','halfscreen,scrollbars')">
ADD this script at the bottom of your page, just before your </body> tag.
(in the page you want to protect)
<script language=JavaScript>
 <!--
var message="ENTER YOUR CUSTOM MESSAGE HERE";
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</script>