压缩后的javascript可以解压吗

发布于 2024-07-29 11:10:26 字数 900 浏览 4 评论 0原文

是否可以解压缩如下代码(如果这是正确的术语)?

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 技术交流群。

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

发布评论

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

评论(5

旧夏天 2024-08-05 11:10:26

是的。 复制/粘贴到此处: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?

乙白 2024-08-05 11:10:26

我认为像 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.

别念他 2024-08-05 11:10:26

如果您想要做的是查看用于描述代码的原始变量,那么不行。 您始终可以花时间通过格式化程序运行它,以使其更易于视觉阅读,但变量和函数名称将永远丢失。

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.

寂寞清仓 2024-08-05 11:10:26

在您的具体示例中,您应该能够解压缩它。

但请注意,大多数压缩器都会重命名变量。 到那时,在我看来,代码就不再是人类可读的。

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-")
    };

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.

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-")
    };
原来是傀儡 2024-08-05 11:10:26

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.

Here is a screen shot

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