我可以从浏览器视图源中隐藏html源代码吗? [英] can i hide the html source code from the browser view source?

查看:163
本文介绍了我可以从浏览器视图源中隐藏html源代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以隐藏浏览器的源代码(特别是HTML页面)。 viewsource
如果比如何?

如果不是比其他方式安全我的页面代码?

解决方案

不,你不能这样做。不可能有效地隐藏HTML 。

您可以阅读这个,因为这会给你一些其他的选择来保护你的网页。


源代码填充



真的,这本书中最古老的技巧。它涉及在代码开始之前添加大量的
空白区域,以便查看源菜单
显示为空白。但是,必须所有的人都会注意滚动条
,并会滚动查找您的代码。如同
这样毫无意义和愚蠢的做法,还有一些人在使用它。



没有右键单击脚本



这些脚本阻止用户右键单击View Source
函数所在的位置。缺点:非常难以在
浏览器上工作,并且实际上可以正常工作。右键菜单或
上下文菜单包含许多对用户有用的工具,包括
导航按钮和书签页按钮。大多数用户不会
善意地禁用浏览器功能,
倾向于不重新访问这些页面。查看源代码功能也是
通过顶部的菜单。在
浏览器顶部的主菜单栏中,选择查看,然后在子菜单中,您会看到查看
来源或类似的内容。此外,还有像
Ctrl + U这样的键盘快捷键可用于查看源代码。所有这些方法的作用就是将
添加到试图查看源代码的人两秒钟左右,
确实会刺激不想查看源代码的用户。



JavaScript加密

这是迄今为止最流行的尝试隐藏源代码的方法。
它涉及到你的代码,使用一个自定义的函数
以某种方式加密它,然后把它放在一个HTML文件以及一个
函数将解密它的浏览器。用户可以查看
的来源,但是这是不可理解的。缺点:您的网站是
,只能启用JavaScript的用户使用。这排除了搜索
引擎,选择禁用JavaScript的用户以及使用
文本浏览器(如盲人)的用户,这些浏览器没有JavaScript
功能。请记住,JavaScript是奢侈品,而不是
网站上的必需品。你必须包含一个解密页面的方法,以便浏览器
可以显示它。理解JavaScript的人可以轻松解密
页面。许多浏览器提供了替代方法。一些
允许您保存页面,解密以便稍后查看。其他人,像FireFox这样的
,包括像DOM Inspector这样的工具,它允许你
轻松地查看和复制页面的XML,解密。



HTML保护软件

有一些不诚实的人想卖你软件
快速方便地保护你的源代码。这种类型的
软件通常采用上述方法,以各种方式隐藏
源代码。许多人认为,如果他们购买它,
必须工作。它不。正如我们所看到的,上述方法都很容易绕过
,所有这些软件都是为你实施这些可怕的
有缺陷的方法,并拿走你的钱。不要为他们倒下,我已经有
,但看到一个工作,而且他们永远不会。


复制的内容,如果万一以后链接死了。


I want to know can i hide the source code(special for HTML PAGE) from browsers.viewsource ? if yes than how ?
And if no than other way to secure my page code ?

解决方案

No you cant do that.It is impossible to effectively hide the HTML.

You can read this as this will give you some other alternatives to secure your page.

Source Code Padding

Really, the oldest trick in the book. It involves adding a ton of white space before the start of your code so that the view source menu appears blank. However, must all people will notice the scroll bars and will scroll around to find your code. As pointless and silly as this method is, there are some still who use it.

No Right Click Scripts

These scripts stop users from right-clicking, where the "View Source" function is located. Cons: Notoriously hard to get working across browsers and to actually work properly. The right-click menu, or context menu, includes many helpful tools for users, including navigation buttons and the "Bookmark Page" button. Most users don't take kindly to having their browser functionality disabled and are inclined not to revisit such pages. The View Source function is also available through the top Menu. At the main menu bar at the top of your browser, select View, and then in the sub-menu, you'll see "View Source" or something similar. Also, there are keyboard shortcuts like Ctrl+U that can be used to view source. All this method does is add about a two second delay to someone trying to view your source and it does irritate users who aren't trying to view your source.

"JavaScript Encryption"

This is by far the most popular way to try to hide one's source code. It involves taking your code, using a custom made function to "encrypt" it somehow, and then putting it in an HTML file along with a function that will decrypt it for the browser. A User is able to view the source, however, it isn't understandable. Cons: Your website is only usable for users with JavaScript enabled. This rules out search engines, users who've chosen to disable JavaScript, and users using a textual browser (such as the blind) that doesn't have JavaScript capabilities. Remember, JavaScript is a luxury, not a necessity on the web. You have to include a means of decrypting the page so the browser can display it. Someone who understands JavaScript can easily decrypt the page. Many browsers provide alternative ways around this. Some allow you to save the page, decrypted for easy viewing later. Others, like FireFox, include tools like the DOM Inspector, which allows you to easily view and copy the XML of the page, decrypted.

HTML Protection Software

There are some less than honest people who want to sell you software to quickly and conveniently "protect" your source code. This type of software generally employs the above methods, in varying ways, to hide your source code. Many people think that if they are buying it, it must work. It doesn't. As we've seen, the above methods are all easily circumvented, and all this software does is implement these horribly flawed methods for you and take your money. Don't fall for them, I've yet to see a single one that's worked, and they never will.

Copied the content if in case the link goes dead in future.

这篇关于我可以从浏览器视图源中隐藏html源代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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