有什么方法可以逆转闭包编译器(或类似的)对代码的影响吗?

发布于 2024-12-10 12:55:35 字数 606 浏览 0 评论 0原文

我最近刚刚接手了一个项目,因为我的客户以前的网络开发人员消失了。我必须使用的唯一文件是存储在本地服务器上的文件。我遇到的唯一问题是所有 JS 都通过闭包编译器(或类似的东西)运行,这使得 javascript 读起来非常烦人(至少对于更大的函数来说)。有没有什么可以帮助我在 JS 中重新插入变量,以便我有更干净的东西可以看?我一直都是手工做的,而且变得相当乏味。

这是我正在处理的一个例子:

    var n = {},
        e = a.extend(n, x),
        y = "pageLoaded",
        u = "pageLoading",
        c = "modLoaded",
        w = "xhrComplete",
        l = true,
        v = false,
        s = a("body"),
        g = Modernizr.historymanagement,
        f = "",
        t = "",
        r = "",
        k = null,
        b = window.History;

提前谢谢!

特雷

I just recently took over a project because my clients previous web dev disappeared. The only files I have to work with are what is stored on the local server. The only problem I've encountered is all of the JS has been run through Closure Compiler (or something of the like) which makes the javascript really annoying to read (at least for the bigger functions). Is there anything out there that would help me replug vars in JS so I have something cleaner to look at? I've been doing it by hand and it's getting quite tedious.

Here's an example of what I'm dealing with:

    var n = {},
        e = a.extend(n, x),
        y = "pageLoaded",
        u = "pageLoading",
        c = "modLoaded",
        w = "xhrComplete",
        l = true,
        v = false,
        s = a("body"),
        g = Modernizr.historymanagement,
        f = "",
        t = "",
        r = "",
        k = null,
        b = window.History;

Thanks ahead of time!

Tre

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

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

发布评论

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

评论(1

行至春深 2024-12-17 12:55:35

不,已经烂了。在某种程度上,您可以在分配文字时替换标记 - 例如,您可以将 l 的所有实例替换为 true ,将 v 替换为代码中的false。但它所做的其他事情要逆转要复杂得多,我不相信有人会为此付出太多努力。

No. It's munged. To a certain degree you can replace tokens when literals are assigned - you could, for example, replace all instances of l with true and v with false in the code. But there are other things which it does that would be a lot more complex to reverse and I don't believe anyone's put much effort into it.

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