压缩后的javascript可以解压吗
是否可以解压缩如下代码(如果这是正确的术语)?
var vote=function(){var k={informModerator:-1,undoMod:0,acceptedByOwner:1,upMod:2,downMod:3,offensive:4,favorite:5,close:6,reopen:7,deletion:10,undeletion:11,spam:12};var f=imagePath+"vote-arrow-down.png";var c=imagePath+"vote-arrow-down-on.png";var x=imagePath+"vote-arrow-up.png";var w=imagePath+"vote-arrow-up-on.png";var A=imagePath+"vote-favorite-on.png";var o=imagePath+"vote-favorite-off.png";var l=function(){var C='<a href="/users/login?returnurl='+escape(document.location)+'">login or register</a>';$("div.vote").find("img").not(".vote-accepted").unbind("click").click(function(D){u($(D.target),"Please "+C+" to use voting.")});z().unbind("click").click(function(D){u($(D.target),"Please "+C+" to flag this post.")})};var B=function(C){if(!C){C="div.vote"}$(C).find("img.vote-
我在 stackoverflow 上搜索了这个问题,但没有找到结果
Is it possible to uncompress (if that's the right term even) for code like below?
var vote=function(){var k={informModerator:-1,undoMod:0,acceptedByOwner:1,upMod:2,downMod:3,offensive:4,favorite:5,close:6,reopen:7,deletion:10,undeletion:11,spam:12};var f=imagePath+"vote-arrow-down.png";var c=imagePath+"vote-arrow-down-on.png";var x=imagePath+"vote-arrow-up.png";var w=imagePath+"vote-arrow-up-on.png";var A=imagePath+"vote-favorite-on.png";var o=imagePath+"vote-favorite-off.png";var l=function(){var C='<a href="/users/login?returnurl='+escape(document.location)+'">login or register</a>';$("div.vote").find("img").not(".vote-accepted").unbind("click").click(function(D){u($(D.target),"Please "+C+" to use voting.")});z().unbind("click").click(function(D){u($(D.target),"Please "+C+" to flag this post.")})};var B=function(C){if(!C){C="div.vote"}$(C).find("img.vote-
I did search stackoverflow for this question and found no results
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的。 复制/粘贴到此处:http://jsbeautifier.org/
这只会重新格式化布局。 您无法恢复变量/函数名称。
与 MetaSO 相关:我们可以获得投票对象的未混淆版本吗?
Yes. Copy / paste here: http://jsbeautifier.org/
That will only reformat the layout. You cannot restore variable/function names.
Related on MetaSO: Can we get an un-obfuscated version of the vote object?
我认为像 Eclipse 这样的东西可以为你自动格式化它。 但无法取回任何原始变量名称。
I think something like Eclipse can auto-format it for you. Won't be able to get back any of the original variable names though.
如果您想要做的是查看用于描述代码的原始变量,那么不行。 您始终可以花时间通过格式化程序运行它,以使其更易于视觉阅读,但变量和函数名称将永远丢失。
If what you are trying to do is see the original variables used to describe the code, then no. You can always take the time to run it through a formatter to make it easier to read visually but the variable and function names are lost forever.
在您的具体示例中,您应该能够解压缩它。
但请注意,大多数压缩器都会重命名变量。 到那时,在我看来,代码就不再是人类可读的。
In your specific example, you should be able to uncompress it.
Note, however, that most compressors will rename variables. At that point, the code is, IMO, no longer human readable.
Google Chrome 开发者工具的“源”选项卡中有一个名为“Pretty Print”的功能。 单击大括号图标并查看格式化的代码。
There is a feature called "Pretty Print" at Source tab in Developer Tools of Google Chrome. Click on curly bracket icon and see the formatted code.