-2

No "View Page Source" option, rather it is showing "View Selection Source"

How a developer can hide the "View Page Source" option from right click menu like this? I got right click menu options but no "View Page Source" option in the full website. How to do it?

icecub
  • 8,615
  • 6
  • 41
  • 70
  • its pointless, it does noting, any one can get around it. just accept anything sent to the browser is viewable –  May 19 '18 at 05:59
  • This will be similar to https://stackoverflow.com/questions/737022/how-do-i-disable-right-click-on-my-web-page – Rohith Murali May 19 '18 at 06:11
  • It's called a "custom context menu". Using Javascript you can create your own right click context menu. But as @smith said, it's pointless. The browser cannot display a website without receiving the source code and therefor a user can _always_ get their hands on the source one way or another. – icecub May 19 '18 at 06:11

1 Answers1

0

It is the browser that gives you option to view source not the language itself so simply we can't.

<body oncontextmenu="return false;">
kish
  • 151
  • 3
  • 16