简体   繁体   中英

How to hide html source code? Even when viewing source?

I found this website https://samy.pl/ and even with my HTML knowledge I can't find the source of his site?

If you type "view-source:" before the website it should bring up the source but it doesn't?

He blocked most or all ways to inspect his source.

How is this possible?

You can actually see the sourcecode using Internet Explorer, or Safari with IE 11 set as useragent.

I'm not certain how he does it, but it is some kind of JavaScript that checks some flag in Chrome that tells him whether or not the inspector is open, and if true he removes the body and updates page so everything disappears.

Using IE and inspecting the source should give you the answer :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM