How to beautify Javascript and CSS in Firefox / Firebug?

巧了我就是萌 提交于 2019-11-29 02:10:38

问题


Is there a way to beautify javascript and css in Firebug? I'd like to be able to view formatted js instead of the compressed version :).


回答1:


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. ;-)




回答2:


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/




回答3:


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.

Tested on Firefox 42.



来源:https://stackoverflow.com/questions/3216583/how-to-beautify-javascript-and-css-in-firefox-firebug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!