开发者

How can I beautify JavaScript and CSS in Firefox / Firebug?

开发者 https://www.devze.com 2023-01-06 03:56 出处:网络
Is there a way to beautify JavaS开发者_开发问答cript and CSS in Firebug? I\'d like to be able to view formatted JavaScript code instead of the compressed version :).There is now a plugin that intercep

Is there a way to beautify JavaS开发者_开发问答cript and CSS in Firebug?

I'd like to be able to view formatted JavaScript code instead of the compressed version :).


There is now a plugin that intercepts JavaScript downloads and deminifies it at that point.

Unfortunately, the way it hooks into Firefox means that it applies to all JavaScript downloads and just not specific ones and the JavaScript files have to be served with an appropriate MIME type.

https://addons.mozilla.org/en-US/firefox/addon/247565/


CSS is already beautified in Firebug, as clearly seen by comparing the CSS tab or CSS pane with the raw source.

JavaScript, alas, is not. The best you can do, for now, is to paste the code into something like http://jsbeautifier.org/ .

However, if you write a Firebug extension that does this, you will have all of our gratitude. ;-)


Firefox Developer Tools has:

  • "Prettify Source" button: braces {} icon on bottom left

  • "Auto Prettify Minified Sources" setting: turns Prettify Source on by default.

    To enable it: go to the engine icon on top right of the Debugger tab, not the global settings engine.

How can I beautify JavaScript and CSS in Firefox / Firebug?

Tested on Firefox 42.

0

精彩评论

暂无评论...
验证码 换一张
取 消