JavaScript 编程:事实上的开源?

发布于 2024-11-27 01:07:30 字数 158 浏览 3 评论 0原文

根据我的理解,JavaScript 代码因为是客户端的,所以不会对客户端隐藏,因此实际上是开源的。

我知道“代码混淆”,但根据维基百科,“最多,混淆只会使对程序进行逆向工程变得耗时,但并非不可能。”

是否有可能真正隐藏您的 JavaScript 代码,使其保持闭源状态?

From my understanding, JavaScript code, because it is client-side, is not hidden to the client, and is hence de facto open source.

I am aware of "code obfuscation", but according to Wikipedia, "At best, obfuscation merely makes it time-consuming, but not impossible, to reverse engineer a program."

Is it possible to truly hide your JavaScript code, to keep it closed source?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾城泪 2024-12-04 01:07:30

开源并不意味着“我可以看到源代码”。广义上,这意味着“许可证允许我重新分发此源代码并用它做我喜欢的事情[免责声明:请参阅许可条款]”。所以你的术语是错误的。

最终,如果您将 Javascript 传送到用户 PC 上的 Web 浏览器,则用户对其的访问权限与他的 PC 相同。你不能禁止这样做。你可以通过混淆来稍微缓解它,但维基百科的引用是绝对正确的。

只需提供高质量的软件即可继续前进。

Open-source doesn't mean "I can see the source". It means, loosely, "the licence allows me to re-distribute this source and do what I like with it [disclaimer: see licence terms]". So your terminology is in error.

Ultimately, if you are delivering your Javascript to a web browser on your user's PC, the user has as much access to it as does his PC. You can't prohibit that. You can mitigate it slightly with obfuscation, but the Wikipedia quote is absolutely correct.

Just provide quality software and move on.

意中人 2024-12-04 01:07:30

不,这是不可能的,但许可可以阻止盗窃。

No it is not possible, but licensing can deter theft.

娜些时光,永不杰束 2024-12-04 01:07:30

您无法向用户隐藏前端 javascript(除非您正在谈论服务器端 javascript,例如 node.js,但这完全是一个不同的主题),但如果您的目标是通过以下方式尽可能隐藏它混淆、JavaScript 压缩并不是一个坏方法。 Google 有一个非常好的 JavaScript 压缩器,它可以让你的代码几乎不可能被逆向工程。此外,它还可以使您的代码占用更少的空间,这意味着它将加载得更快。

http://code.google.com/speed/articles/compressing-javascript.html

You can't hide your front-end javascript from the user (unless you're talking about server side javascript such as node.js, but that's a different topic alltogether), but if your goal is to hide it as much as possible via obfuscation, javascript compression isn't a bad way to go about it. Google has a really good javascript compressor that will make you code all but impossible to reverse engineer. Additionally, it also makes your code take up less space, which means it will load faster.

http://code.google.com/speed/articles/compressing-javascript.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文