LoginSignup
1
0

More than 5 years have passed since last update.

FirefoxのJavaScriptデバッガー

Last updated at Posted at 2018-06-20

はじめに

Firefoxでどこに値が入ってるかわからなかったので、ブレークポイントを指定して処理をとめてデータを確認します。

セクション

Firefoxで about:debugging のページで、アドオンの左下にあるデバッグをクリックして、デバッガータブを開きます。止めたいソースコードの行数を左クリックしてマークします。

image.png

javascriptの動作する処理(このコード例だとページ上でテキストを選択の上で右クリック、get selected text メニューを選択)をします。

image.png

選択していた文字が、info.selectionText に保管されているのがわかります。

image.png

このテストケースだと console.log で info を出力させると selectionText に入ってるのはわかるのですが、どんなデータが入ってるかわからないときには止めてみてみるのは役にたちそうです。

console
Object { menuItemId: "selectText", parentMenuItemId: 10, frameId: 0, editable: false, 
pageUrl: "https://qiita.com/keniooi/items/890...", selectionText: "csplit でファイル分割", 
modifiers: Array[0] }

やり方は知ってて当然かもしれませんが、一から自分で書いたコードでない場合に調べるのには使えそうです。

参考

デバッガー - 開発ツール

1
0
0

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
1
0