-1

After reading this post I'm curious to know if it is possible to disable scrolling eg: overflow:hidden when viewing source code of a web page.

I have read that it is not professional to try to hide the source code of a web page and I agree with that so my question is more about "what can be done or not" and not about "should I do it or not".

Thank you.

Community
  • 1
  • 1
Merlin
  • 4,907
  • 2
  • 33
  • 51
  • Usually `View source` functionality is provided by an external application (not sure if in Chrome). When I view a source of a page, it's opened with Notepad++, can you imagine a JavaScript code, which could affect a programm run outside of the browser? – Teemu Apr 17 '14 at 00:21

2 Answers2

2

Not possible and even if it was, it would be pointless, as one could always get the source otherways. E.g. cURLing it.

nhaa123
  • 9,570
  • 11
  • 42
  • 63
2

You can not hide the source code. But you can try to obfuscate the source to make it harder to reverse engeneer your code. If you use PHP than take a look at the free Html Encoder for ionCube. But be aware that your visitors can always see the DOM tree and reverse engeneer the code. And remember: When your visitors disabled javascript they can't access your site.

Marcus Wölk
  • 512
  • 1
  • 6
  • 26