Skip to content

How to inspect tree of tabs

YUKI "Piro" Hiroshi edited this page Jun 28, 2024 · 18 revisions

(generated by Table of Contents Generator for GitHub Wiki)

How to start debugger for Tree Style Tab?

  1. Type about:debugging into the address bar and hit the Enter key.
  2. Choose "This Firefox" at the left pane.
  3. Find "Tree Style Tab" from the list and click the Inspect button.
  4. Then a debugger tab is opened.

How to inspect the sidebar?

  1. Start the debugger for TST.
  2. On the top-right corner of the debugger window, there are some buttons, so click the Select an iframe as the currently targeted document button.
  3. Choose /sidebar/sidebar.html from the list.
    • If you are opening multiple browser windows with their sidebar, you'll see multiple entries in the list.
    • /sidebar/sidebar.html items are sorted by the order they are initialized. If you hope to inspect the sidebar in the first browser window, you should choose first /sidebar/sidebar.html item in the list.
  4. Choose the Inspector tab.

If you see any fatal problem around TST's startup process (in such cases the sidebar may show only a throbber and get stuck), run gMetricsData.toString() in the Console tab of the debugger. It reports detailed report of the startup process, and the report may help debugging.

How to inspect the background page (master process)?

  1. Open the Web Inspector by pressing Ctrl+Shift+I or by right-clicking and selecting Inspect.
  2. Open Web Inspector Settings by clicking the three dots ... on the top-right corner of the inspector window and then selecting Settings.
  3. Ensure that both Enable browser chrome and add-on debugging toolboxes and Enable remote debugging are checked.
  4. Open the Browser Toolbox by pressing Ctrl+Alt+Shift+I or selecting More tools and then Browser Toolbox from the three-bar menu in the top right of the window.

If you see any fatal problem around TST's startup process (in such cases the sidebar may show only a throbber and get stuck), run gMetricsData.toString() in the Console tab of the debugger. It reports detailed report of the startup process, and the report may help debugging.

How to capture tabs?

If you see odd behavior around tabs (broken order, invisible tabs, etc.) captured tabs will help debugging. You can capture tabs as HTML by these steps:

  1. Start debugger for TST and choose the sidebar you want to inspect.
  2. Right-click on the node <div id="tabbar" ...> (sidebar) or <div id="all-tabs"> (background page) in the tree, and choose Copy => Outer HTML.
  3. Switch to the Console tab and run JSON.stringify(Array.from(TabsStore.windows.values(), window => { return { id: window.id, tabs: window.export(true).map(tab => Object.assign({}, tab, { favIconUrl: null })) }; })).

Then please post the captured HTML (at the step 2) and JSON (at the step 3) as extra detailed information for an issue. If there are some sensitive information, instead please e-mail it to [email protected].

How to collect debug logs of TST?

  1. Go to TST's configurations and turn the checkbox "Development" => "Debug mode" on. image
  2. Start debugger for TST.
  3. Choose the "Console" tab.
  4. Click the dustbox icon to clear old logs.
  5. Run steps to reproduce the problem you met.

On TST 2.4.22 or later, you can collect recent 1000 logs after things happened. It will help us to collect logs appearing only on the startup process of the browser itself. In the remote debugger's console, please run: log.logs.join('\n')

How to collect startup logs of TST?

Startup logs will help us to understand what happened on your environment, when you see blank sidebar with failed initialization of TST.

  1. Start your Firefox with TST.
  2. Confirm that TST failed to initialize.
  3. Go to about:debugging
  4. Click "This Firefox" in the left sidebar.
  5. Click "Inspect" button of the Tree Style Tab item in the list of extensions.
  6. A debugger window is opened.
  7. Click iframe chooser icon and choose "/background/background.html".
    image
  8. Choose "Console".
  9. Run a script: import('/common/MetricsData.js').then(ns =>console.log(ns.default.toString()))
  10. Collect the output.
  11. Click iframe chooser icon and choose "/sidebar/sidebar.html".
  12. Run a script: import('/common/MetricsData.js').then(ns =>console.log(ns.default.toString()))
  13. Collect the output.

Collected logs may be shorter than the one on the success case, if something happens while TST's initialization, and it may help to understand where TST was failed at.

How to collect a performance profile?

On recent versions Firefox, you need to use the browser toolbox of TST itself instead of debugger for TST.

  1. Hit F12 key to open the web developer tool.
  2. Hit F1 key, or click the "..." button and choose the "Settings" item.
  3. Scroll down and turn checkboxes on: Enable browser chrome and add-on debugging toolboxes" and "Enable remote debugging".
  4. Hit Alt-Ctrl-Shift-I to open the browser toolbox.
  5. Choose "Performance" tab in the browser toolbox window.
  6. Choose "Firefox" from the "Settings" list, and click the "Start recording" button, in the browser toolbox window.
  7. Try scrolling the tab bar and confirm it is slow.
  8. Click the "Capture recording" button in the browser toolbox window.
  9. Click the "Upload Local Profile" button in the top area.
  10. A popup dialog appears so click the "Download" button.
  11. Share the downloaded file.

On old version Firefox you can collect performance profile with the debugger for TST.

  1. Start debugger for TST.
  2. Choose the "Performance" tab. If there is no such tab, you'll activate the panel by these steps: click the three dots at the top-right edge of the debugger, choose "Settings", and activate "Performance" listed in the "Default Developer Tools".
  3. Click the "Start Recording Performance" button.
  4. Do steps to reproduce a performance problem you saw.
  5. After a performance problem is produced, click the "Stop Recording Performance" button.
  6. See the left pane then you'll see a list of results like "Recording #1".
  7. Click the "Save" link of a recorded result. You can download a "profile.json" file.
  8. Attach the "profile.json" to an issue or upload somewhere.
Clone this wiki locally