LoginSignup
34

More than 5 years have passed since last update.

Chromeデベロッパーツールで圧縮(minified)されたJavaScriptを読みやすく表示する

Posted at

以下の内容は、Googleの開発者向けページにある 読みやすい形式への JavaScript の変換 ほぼそのままです。

(引用)

JavaScript を読みやすい形式に変換するには、Chrome DevTools で [Pretty-Print] アイコンをクリックします。

実際にやってみます。

たとえばGoogle Earthapp_ja.js のソースコードは圧縮されているので次のように表示されますが、これだと読める気がしませんね。
image

そんなときには、 Pretty Print {} のアイコンをクリックします。
image

すると、 app_ja.js:formatted というタブの中に、読みやすく整形されたスクリプトが表示されます。
image

ちなみに、デバッグ時のブレイクポイントはformatted側に設定すれば良いので、既定のAPIを使うような開発作業も楽になりますね。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34