如何防止您的 JavaScript 代码被盗、复制和查看? [英] How to prevent your JavaScript code from being stolen, copied, and viewed?

查看:32
本文介绍了如何防止您的 JavaScript 代码被盗、复制和查看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 100% 的保护是不可能的,但是一些高的或者对大多数用户有用的东西.

I know its impossible for 100% protection, but something high or that works for majority of the users.

例如,我遇到一个网站,查看当前页面的源代码没有任何返回.

For instance, I encountered a site where viewing the current page's source returned nothing.

在另一种情况下,从浏览器访问或尝试下载 .js 文件本身

In another case, accessing or trying to download the .js files itself from browser

http://gget.com/somesecret.js,

会重定向你和其他东西.

would redirect you and stuff.

如果你混淆你的代码,解码它会非常困难吗?如果是这样,那也是另一个很好的解决方案(推荐什么软件)?

If you obfuscate your code, will it be very very difficult to decode it? if so that is also another good solution (what software is recommended) ?

推荐答案

您可以混淆您的 Javascript.在野外有很多工具可以做到这一点,例如http://www.javascriptobfuscator.com/.然而,它不会阻止任何人看到代码,但会增加阅读难度.

You could obfuscate your Javascript. There are a lot of tools to do that in the wild, e.g. http://www.javascriptobfuscator.com/. However it does not prevent anyone to see the code, but makes it harder to read.

这篇关于如何防止您的 JavaScript 代码被盗、复制和查看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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