In the process of developing the website sometimes we do not want to let the customer see the source code of the page, even the text content on the page does not want to be copied, let's look at how to protect the page content
Prevent viewing of page source code and copying text from pages
<body style=" oncontextmenu="return false" onselectstart="return false">
We all know that even if you set the Disable right button but click F12 still can see the source code, below we set to prohibit the use of F12
<script> function Fuckyou () {window.close ();//close Current window (anti-suction) window.location = "About:bla NK "; Jumps the current window to a blank page} function ck () {console.profile (); Console.profileend (); We judge profiles inside there is no thing, if there is, someone must press F12, yes!! if (console.clear) {console.clear ()}; if (typeof console.profiles = = "Object") {return console.profiles.length > 0; }} function hehe () {if (Window.console && (console.firebug | | console.table && /firebug/i.test (Console.table ()))) | | (typeof opera = = ' object ' && typeof opera.posterror = = ' function ' && console.profile.length > 0)) {fuckyou (); } if (typeof console.profiles = = "Object" && console.profiles.length > 0) {fuckyou () ; }} hehe (); Window.onresize = function () {if (window.Outerheight-window.innerheight) > 200)//Judge the current window height and window height, if the difference is greater than 200, then hehe fuckyou (); }</script>
Using the above JS code can prohibit the use of F12, note: The above JS code is not my own writing, has forgotten what the great God wrote ~ ~
Finally we know that the picture in the browser mouse as long as a drag will be saved, but the background image will not be dragged, the following code can make the picture in the page disable the mouse drag
<body style="ondragstart="return false">
Disable viewing of source code in Web page (protect source code)