Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Whole js vanishes with JSB turned on #1

Open
ChaosCom opened this Issue Oct 21, 2011 · 2 comments

Comments

Projects
None yet
2 participants

Hi, could you please have a look at https://github.com/test/me (that is, a nonexisting project, which causes an error page to come up). Usually the error page on github contains a nifty little image that's empowered by javascript to achive a parallax effect (Image appears to be (Pseudo-) 3D when you move the mouse). But with the deminifier turned on, some of the scripts don't even load it seems (so the effect is gone). I would attach an image to show what I mean if only github had such a functionality.

Needless to say, this makes debugging sites completely useless, because you never can be sure whether a (more subtle) script is missing. I wonder why the scipts simply vanish? Couldn't the jsdeminifier simply "fall back" to a unminified version of the script in case it "chokes" on one? Would it also be possible to have an Firebug-only extension (either as new tab inside Firebug or even better integrated into Firebug's Javascript tab), e.g. a button simply stating "Deminify" and when pressed, it would output the deminified js code into firebugs own code window?

@benmmurphy benmmurphy was assigned Oct 21, 2011

Owner

benmmurphy commented Oct 21, 2011

thanks for the bug report. in my initial investigation i've found that is is decompiling the javascript but the decompiled output is incorrect and this causes the javascript to disappear from the list of scripts in firebug.

i get the following error in my firebug console:

missing ; before statement
[Break On This Error] for (var c in b) / ace - /.tes...urn!/ ^ \t / m.test(a || this.code())

i will work on trying to get it to decompile properly. unfortunately, this is quite difficult to solve generally without changes to the firefox code. a proper solution would allow firebug access to the pretty-printed AST. we de-obfsucate javascript by intercepting the network call and replacing the output from the network with the output from the decompiler. it is quite difficult to determine if the decompiled javascript parses correctly.

Owner

benmmurphy commented Nov 23, 2011

i've tried using uglifyjs as an alternative javascript parser because it is much more robust. it works fine on the github js outside of the browser using node. unfortunately, it crashes with a stack error when used in firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment