网站可以禁用查看源吗? [英] can view source be disabled by a website?

查看:69
本文介绍了网站可以禁用查看源吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建一个不允许显示网站资源的网页?

Is it possible I create a webpage that doesn't allow the website source to be displayed?

推荐答案

否,您无法隐藏Web服务器的纯文本HTML输出.

No, you cannot hide the plain text HTML output of your web server.

如何生成HTML与从服务器发送的实际HTML是分开的.

How the HTML is generated is separate form the actual HTML that gets sent from the server.

这是设计互联网和万维网的方式.如果您使用服务器端脚本化的Web应用程序生成HTML,则只要人们无权浏览服务器上的实际脚本文件,您的商业智能/流程/代码就会被隐藏.

This is the way the internet and world wide web were designed. If you are using a server-side scripted web application to generate your HTML, then your business intelligence / process / code is hidden, provided that people do not have access to browse the actual script file on your server.

如果您要自定义一种开源浏览器(如Firefox或Chrome),则可以禁用查看源代码"功能.对于某些Intranet或内部业务应用程序,这可能是一个值得选择的选择. XUL和Firefox是我们公司希望控制最终用户可以访问的内容的可能性之一.您唯一需要确保源代码安全的真正安全性是在服务器端,因为网络/协议监视器仍然可以在HTML通过网络移动时提取HTML.

If you would like to customize one of the open source browsers, like Firefox or Chrome, you could disable the "view source" functionality. It might be a worthwhile option for certain intranet or internal business applications. XUL and Firefox is one of the possibilities our company looked at to control what the end user could access. The only real security you have to keep your source secure is on the server side, as network / protocol monitors could still pull the HTML as it moves over the network.

这篇关于网站可以禁用查看源吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆