How to prevent the page with F12 in Browser (Console log and development tool)


On the browser when we click on F12 when we have seen a window that called Console log and development tool. So if we do not want show our client side code then we can use below code then can stop to open console log window on click F12 and right click of mouse


Source Code:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="consolelogstatus.aspx.cs" Inherits="consolelogstatus" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Console Log Status</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
    <script>
        $(document).keydown(function (event) {
            if (event.keyCode == 123) {
                return false;
            }
            else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) {
                return false;
            }
        });

        $(document).on("contextmenu", function (e) {
            e.preventDefault();

        });

    </script>
</head>

<body>
</body>

</html>



How to prevent the page with F12 in Browser (Console log and development tool) How to prevent the page with F12 in Browser (Console log and development tool)  Reviewed by NEERAJ SRIVASTAVA on 11:22:00 PM Rating: 5

No comments:

Powered by Blogger.