How can I, as a non-WebExtension developer, ascertain what a tab's ID is?

When I was diagnosing bugzilla.mozilla.org/show_bug.cgi?id=1969259#c3, [1] ascertaining which tab to attach to was nigh impossible:

My sole workaround thus far has been to close the tab of interest, then reinvoke it, to ensure that it’s provided the highest tab number.

However, this shan’t work for tabs which I need to not die. In that case, the sole way I’ve heard of is to install a custom WebExtension, with the undermentioned content constituting its background.js:

#!/usr/bin/env firefox
browser.tabs.query(
	{
		active: true,
		currentWindow: true
	}
).then(
	(tabs) => {
		console.log(
			"Active tab ID:",
			tabs[0].id
		);
	}
);

However, I’ve no desire to create an extension for this purpose.

I see an answer mentioning about:processes and about:memory at support.mozilla.org/questions/1354296#answer-1451620, which is marked as a solution. However, I’ve yet to notice anything relevant there.


  1. bugzilla.mozilla.org/page.cgi?id=comment-revisions.html&bug_id=1969259&comment_id=17514320 ↩︎

If you hover a tab with your pointer, on nightly, the Process ID is displayed in the tooltip text. Would that help?

image

1 Like

@pascal, thank you. That’s perfect, for WinDbg exposes the PID:

  1. image

Does an about:config preference exist that allows me to gain this outside Nightly?

I digged a bit and yes, you can activate it by setting this pref to true:

browser.tabs.tooltipsShowPidAndActiveness
1 Like