Anti-F12/Inspect HTML! Protect your sites!

Status
This thread has been locked.

goodnight

night#8111
Banned
Feedback score
7
Posts
241
Reactions
88
Resources
0
Hello! Today I'm giving out my Anti-F12 or Anti-Inspect-Element code for HTML that a friend developed for me.

If you like it, please feel free to leave a rep/vouch. This is very useful for protecting precious website data, or not letting people copy your websites!

HTML:
<script>
     document.onkeydown = function(e) {
        if (e.ctrlKey &&
            (e.keyCode === 67 ||
             e.keyCode === 86 ||
             e.keyCode === 85 ||
             e.keyCode === 117)) {
            return false;
        } else {
            return true;
        }
       };
         $(document).keypress("u",function(e) {
           if(e.ctrlKey)
          {
            return false;
           }
            else
           {
           return true;
          }
        });
    </script>
    <!-- //// -->

    <!-- F12 Prevent script -->

    <script language="JavaScript">
    document.onkeypress = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
           //alert('No F-12');
            return false;
        }
    }
    document.onmousedown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            //alert('No F-keys');
            return false;
        }
    }
     document.onkeydown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            //alert('No F-keys');
            return false;
        }
    }
    </script>
    <!-- //// -->
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,209
Reactions
1,462
Resources
0
Hello! Today I'm giving out my Anti-F12 or Anti-Inspect-Element code for HTML that a friend developed for me.

If you like it, please feel free to leave a rep/vouch. This is very useful for protecting precious website data, or not letting people copy your websites!

HTML:
<!-- F12 Prevent script -->

    <script language="JavaScript">
    document.onkeypress = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
           //alert('No F-12');
            return false;
        }
    }
    document.onmousedown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            //alert('No F-keys');
            return false;
        }
    }
     document.onkeydown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            //alert('No F-keys');
            return false;
        }
    }
    </script>
    <!-- //// -->
What about Right Click -> View page source?
 

1amDev

Designer & Developer
Supreme
Feedback score
30
Posts
511
Reactions
844
Resources
0
Hello! Today I'm giving out my Anti-F12 or Anti-Inspect-Element code for HTML that a friend developed for me.

If you like it, please feel free to leave a rep/vouch. This is very useful for protecting precious website data, or not letting people copy your websites!

HTML:
<!-- F12 Prevent script -->

    <script language="JavaScript">
    document.onkeypress = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
           //alert('No F-12');
            return false;
        }
    }
    document.onmousedown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            //alert('No F-keys');
            return false;
        }
    }
     document.onkeydown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            //alert('No F-keys');
            return false;
        }
    }
    </script>
    <!-- //// -->
Hi there,

I just want to reply here to make sure you realize that there is literally no possible way to hide HTML/CSS content from the end user. Browsers read HTML/CSS content and are able to show you the website based on that. For instance, even if I used your script, I could still type "view-source:example.com" into my Chrome browser and it would still show me that content. Same for right clicking the page or disabling JavaScript totally for the browser. While you can disable some things using JavaScript, people can still get around that and find other ways to see the HTML/CSS of a website. It's just how websites work.

Moral of the story is that you can't hide HTML/CSS content. And make sure to keep any "private data" in a database or in back-end code that way users cannot see that data.

I'm glad you did share this with the community though and are trying to find ways to prevent issues like these. It helps the community quite a lot.

Best regards,
Michael // 1amDev
 
Last edited:

goodnight

night#8111
Banned
Feedback score
7
Posts
241
Reactions
88
Resources
0
Hi there,

I just want to reply here to make sure you realize that there is literally no possible way to hide HTML/CSS content from the end user. Browsers read HTML/CSS content are able to show you the website based on that. For instance, even if I used your script, I could still type "view-source:example.com" into my Chrome browser and it would still should me that content. Same for right clicking the page or disabling JavaScript totally for the browser. While you can disable some things using JavaScript, people can still get around that and find other ways to see the HTML/CSS of a website. It's just how websites work.

Moral of the story is that you can't hide HTML/CSS content. And make sure to keep any "private data" in a database or in back-end code that way other's cannot see that data.

I'm glad you did share this with the community though and are trying to find ways to prevent issues like these. It helps the community quite a lot.

Best regards,
Michael // 1amDev
Thanks for the reply! This was just a simple code a friend and I worked on that was made to disable all easy ways of bypassing f12 to get into the publichtml data. Of course all of the data that is important is stored in backend servers.[DOUBLEPOST=1520309935][/DOUBLEPOST]
Okay.
Ctrl+Shift+I?
oh lol I have a mac computer that I do most of my project work on. I didn't think about that.
 
Banned forever. Reason: Admit to scamming

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,209
Reactions
1,462
Resources
0
Hi there,

I just want to reply here to make sure you realize that there is literally no possible way to hide HTML/CSS content from the end user. Browsers read HTML/CSS content are able to show you the website based on that. For instance, even if I used your script, I could still type "view-source:example.com" into my Chrome browser and it would still should me that content. Same for right clicking the page or disabling JavaScript totally for the browser. While you can disable some things using JavaScript, people can still get around that and find other ways to see the HTML/CSS of a website. It's just how websites work.

Moral of the story is that you can't hide HTML/CSS content. And make sure to keep any "private data" in a database or in back-end code that way users cannot see that data.

I'm glad you did share this with the community though and are trying to find ways to prevent issues like these. It helps the community quite a lot.

Best regards,
Michael // 1amDev
Render entire webpage as an image, then use maps to allow clickable regions, and output base64 blob to user Kappa
 

goodnight

night#8111
Banned
Feedback score
7
Posts
241
Reactions
88
Resources
0
Render entire webpage as an image, then use maps to allow clickable regions, and output base64 blob to user Kappa
buddy, you've crossed the line.

i'm gonna have to ask you to remove yourself from the premises.

seriously though, i'm 14, and have minimal/adequate programming language expertise to do what i need to do to get by. not like i'll ever need it as much as i need algebra 2 in life, right? :Kappa:
 
Banned forever. Reason: Admit to scamming

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,209
Reactions
1,462
Resources
0
buddy, you've crossed the line.

i'm gonna have to ask you to remove yourself from the premises.

seriously though, i'm 14, and have minimal/adequate programming language expertise to do what i need to do to get by. not like i'll ever need it as much as i need algebra 2 in life, right? :Kappa:
Surprisingly, algebra is very important, i.e. writing formulae for the relationship between 2 or more variables.
 

Bayu

★ ⭑ *
Supreme
Feedback score
24
Posts
367
Reactions
136
Resources
0
Surprisingly, algebra is very important, i.e. writing formulae for the relationship between 2 or more variables.

Not as cool as quadratics




X EQUALS NEGATIVE B PLUS OF MINUS THE SQQAAAAAAAARE ROOT OF B SQUARED MINUS FOUR AC ALLLL OVVVEERRR TWO A


and ye ctrl shift I works fine
 

Deathcaptain

Web Designer / Web Developer
Supreme
Feedback score
19
Posts
206
Reactions
79
Resources
0
CTRL + SHIFT + J ;)
But for the typical user they wouldn't know that. Overall nice script :)
 
Last edited:
Status
This thread has been locked.
Top