手把手教你隐藏代码(补充篇)
风小原创 JavaScript
昨天笔者写完隐藏代码一文后,还有若干缺陷,今天来补充完整。另在网页禁用右键功能我把它舍去了,用着不方便,且希望能资源共享。况且完全隐藏代码是不可能的,只能一步步完善,遇到真正的高手,任何防御形同虚设,就如同无论什么软件、游戏都能破解,如同律师总能找到法律漏洞般。所以我们能预防一般的用户已经不错了。
上次说过有个漏洞是可以“另存为”网页,这样无论怎么隐藏代码都不行了,所以今天解决的问题是禁止用户另存网页。
这其实很简单,在网页中添加代码
<noscript> <iframe src=*.html> </iframe> </noscript>
用户在另存网页时,会弹出警告框“无法保存此网页”
昨天开始将的是屏蔽右键代码,今天开始分享其他一些简单的功能
<body onselectstart="return false" //禁用选择文字
oncopy="return false" //禁用复制
oncut="return false" //禁用剪贴
ondragstart="return false" //禁用拖动 >
在firefox上述功能不适用,需再加段代码,建议加在网页重要代码之后,以免干扰
<script type="text/javascript">
<!--
document.oncontextmenu=function(e){return false;}
//-->
</script>
<style>
body {
-moz-user-select:none;
}
</style>
所以综合两篇文章,童靴们点击下面查看效果,可以郁闷一下:左键无法选择,右键无法用,查看不到源代码,想另存网页也不行啦,嘎嘎!还想知道偶3D相册的JavaScript代码?没门!
点击此处查看效果
最后呢,我骂一下firefox:你非要跟IE唱反调,丫的还是可以另存为网页。童靴们浏览偶博客还是用IE吧,偶BS下火狐。
您可能会喜欢:
Filed under 原创javascript, 网站相关. Tags: JavaScript
不错!
看似很实用的!!
[回复]
风小 回复:
August 11th, 2010 at 17:17
[回复]
我又来学习了
[回复]
风小 回复:
August 11th, 2010 at 17:57
[回复]
朋友。。。请问猪头表情如何安装的?
我才更应该用猪头嘛。。
[回复]
风小 回复:
August 11th, 2010 at 18:38
用Custom Smilies插件 表情从偶这里拷过去吧,或者可以发你邮箱
[回复]
飞猪 回复:
August 12th, 2010 at 18:06
发给我嘛。。
[回复]
飞猪 回复:
August 12th, 2010 at 19:53
帅郭啊。。你装的插件的作者是谁呀。。我这边怎么不能替换表情呀。。
[回复]
风小 回复:
August 12th, 2010 at 21:18
Custom Smilies 版本 2.9.1 作者为 Crazy Loong 表情要上传 猪猪表情名要与默认表情的图片名一致,再到后台改表情指代码。
[回复]
飞猪 回复:
August 14th, 2010 at 09:42
嗳。。那我再试试。。谢谢帅郭哒。。
[回复]
那个页面很炫,会不会影响搜索引擎抓取呢?
[回复]
风小 回复:
August 11th, 2010 at 20:15
这个不至于吧
而且这种页面被Google收录了
[回复]
话说我用Firebug,呃,如果别人想拿走,你拦也拦不住,还不如共享的了。
[回复]
风小 回复:
August 11th, 2010 at 20:24
拦是拦不住的,但这是个可以钻研的方向,兴趣而已
[回复]
我说怎么点右键又行了。。原来是共享啦。嘿
[回复]
风小 回复:
August 11th, 2010 at 21:02
[回复]
除了IE Firefox 还有其他浏览器 大多也行 各个都不一样的
[回复]
风小 回复:
August 11th, 2010 at 22:17
是啊 如果一个一个试过去会用很多问题,太懒了,就是写这么点也是逼出来的
[回复]
风小 回复:
August 11th, 2010 at 22:24
一般IE与火狐的差异较大,其他浏览器相近与IE,比如360还是可以用
[回复]
呵呵 来看看你了啊 点点**了啊
[回复]
风小 回复:
August 11th, 2010 at 22:18
[回复]
偶一般都是用ff,嘿嘿,**送上
[回复]
风小 回复:
August 11th, 2010 at 22:20
用FF的很多,以后这不兼容问题解决不了还是要避开了,水平有限
。
[回复]
不错,确实没有找到源码……
[回复]
风小 回复:
August 12th, 2010 at 11:51
[回复]
恩 恩 ,过来回访…学习下,顺便互点那啥啥的
[回复]
风小 回复:
August 12th, 2010 at 21:08
[回复]
如果是用开源的程序,就没必要隐藏代码了。如果真的高手想拿,一般是挡不了的吧。
[回复]
风小 回复:
August 13th, 2010 at 20:21
是的,文章开头已然说明。
[回复]
这些都是“表面华丽,而没有实际意义的”,一般稍微了解点的都挡不了
[回复]
风小 回复:
August 13th, 2010 at 20:20
也许你说的对,但是正因为这方面漏洞很大,所以更有发展空间与研究价值
[回复]
pcyear 回复:
August 14th, 2010 at 10:39
其实,网络本身就是资源共享的,如果人们都在这方面搞,就辱没了网络这个互联网的初衷了。
[回复]
风小 回复:
August 14th, 2010 at 14:33
话是不错,但很多网站都会隐藏掉部分代码,如JavaScript之类,更有些人是卖源码的
[回复]
It is plainly that custom writing services can propose the information about dissertation service hence, you would very easily buy a paper and thesis service just about this good post
[回复]
Yeah certainly very operative for the peruser it was pleasant to read about this good post! If you need to get a great job firstofall you need resume writers. Study and don’t forget – if you have to work and study at the same time, there areprofessionals who are ready to guidance you with your resume when you under time encumbrance and looking for a great job.
[回复]
One thing that can provide your academic success supposes to be professional custom papers writing service. Thus, you can buy essay and celebrate your victory!
[回复]
I constantly submit only original academic assignments and I know it firmly just because I use plagiarism checker.
[回复]
Lots of university students are willing to get a job at the experiences essays online service. It is very prestigious to get a job there!
[回复]
I would be remiss if I did not take advantage of this opportunity to sincerely thank the author for the amount of informative content expressed in such a lively and captivating manner.
[回复]
Not a lot of book reports writing companies are professional enough to create superior quality literature essays paper. It can be complicated to check out if a company is experienced or not.
[回复]
Shift difficult assignments to the shoulders of specialists, order custom essay and sleep tight!
[回复]
Some people don’t believe that a dissertation writing service is able to create perfect dissertation topics, nevertheles I buy the computer thesis of high quality and I am happy.
[回复]
I do not search for writers uk! I just strive to get recommendations if that is OK to buy college term paper uk. I am embarrassed about it!
[回复]
If you try to find place where you can get resume company here is very complete place for you about this post, which provide examples and gives an fortune to learn how make great CV resumes . But this site is more delightful, and more practical.
[回复]
Academic papers writing makes me confused. I cannot make myself inventing something! I do not realize that ordering term papers at custom writing service should be a wise idea.
[回复]