Raffael
Raffael

Reputation: 20045

breakpoints in single-lined js-scripts with firebug

i want to analyze an external js-file. but the file is single-lined and obfuscated. so i cannot set meaningful breakpoints. (though automatical unobfuscation, code-indentation is assumed to be possible).

first of all, what would your suggestion be to overcome that impairement?

i wonder if it is possible to replace an external js-file with an unobfuscated nice-looking (maybe altered one) and have this one executed instead. any ideas?

Upvotes: 5

Views: 184

Answers (2)

Raffael
Raffael

Reputation: 20045

i found a way. i am not accepting my answer as the answer b/c its not as comfortable as i would like it to be. so i am interested in further ideas.

you install foxyproxy and configure a new proxy for '*filename.js' (mind the asterisk!). as you host you use a local server, so '192.168.?.?' or 'localhost'.

thing is if the URL of the js-file to be replaced is 'http://www.abc.net/dir1/dir2/filename.js' then you have to make your new js-file accessible at 'http://[host]/dir1/dir2/filename.js'.

that setup is somewhat complicated. it should be possible to have the js-file replaced by another file anywhere on your disk. but it does the job.

Upvotes: 1

Snowbear
Snowbear

Reputation: 17274

Take some tool which has reformat code option. JetBrains WebStorm for example. It should break the lines so they will be suitable for setting breakpoints.

This should take 5-10 minutes. I doubt you will be able to do anything more without spending much time.

Upvotes: 0

Related Questions