隐藏外部JavaScript [英] Hiding external JavaScript

查看:69
本文介绍了隐藏外部JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的HTML页面中有一个外部JavaScript。有没有办法禁用链接到或查看此js文件?

解决方案

不,没有办法做到这一点。这是一种客户端脚本语言......你不能以任何方式隐藏正在运行的脚本......而不是你可能想要的人隐藏它(将会追踪你的人脚本比一般用户更聪明)。

有许多工具可用于检查javascript, Chrome的工具 Firebug ,任何流量嗅探器, javascript unpackers (虽然辩论是可爱的包装/缩小使得代码更加开箱即用)。



您可以用包装/缩小来阻止人们,但是您不能阻止他们看到/找出代码。


I have an external JavaScript in my HTML page. Is there a way to disable linking to or viewing this js file?

解决方案

No, there is not a way to do this. It's a client-side scripted language...you cannot in any way hide the a script that's running...not from the people you are probably wanting to hide it from (people who would go after your script are smarter than the average user most likely).

There are a number of tools available to inspect javascript, Chrome's tools, Firebug, any traffic sniffer, javascript unpackers (though debate-ably packing/minifying makes the code less "out of the box" usable).

You can deter people with the packing/minification, but you cannot prevent them from seeing/figuring out the code.

这篇关于隐藏外部JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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