diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /browser/components/tabpreview/tab-preview-panel.mjs | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/tabpreview/tab-preview-panel.mjs')
-rw-r--r-- | browser/components/tabpreview/tab-preview-panel.mjs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/browser/components/tabpreview/tab-preview-panel.mjs b/browser/components/tabpreview/tab-preview-panel.mjs index 683b2c17ec..40874dbbf6 100644 --- a/browser/components/tabpreview/tab-preview-panel.mjs +++ b/browser/components/tabpreview/tab-preview-panel.mjs @@ -38,6 +38,12 @@ export default class TabPreviewPanel { "browser.tabs.cardPreview.showThumbnails", false ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + "_prefShowPidAndActiveness", + "browser.tabs.tooltipsShowPidAndActiveness", + false + ); this._timer = null; } @@ -132,6 +138,17 @@ export default class TabPreviewPanel { this._displayTitle; this._panel.querySelector(".tab-preview-uri").textContent = this._displayURI; + + if (this._prefShowPidAndActiveness) { + this._panel.querySelector(".tab-preview-pid").textContent = + this._displayPids; + this._panel.querySelector(".tab-preview-activeness").textContent = + this._displayActiveness; + } else { + this._panel.querySelector(".tab-preview-pid").textContent = ""; + this._panel.querySelector(".tab-preview-activeness").textContent = ""; + } + let thumbnailContainer = this._panel.querySelector( ".tab-preview-thumbnail-container" ); @@ -171,4 +188,18 @@ export default class TabPreviewPanel { } return this.getPrettyURI(this._tab.linkedBrowser.currentURI.spec); } + + get _displayPids() { + const pids = this._win.gBrowser.getTabPids(this._tab); + if (!pids.length) { + return ""; + } + + let pidLabel = pids.length > 1 ? "pids" : "pid"; + return `${pidLabel}: ${pids.join(", ")}`; + } + + get _displayActiveness() { + return this._tab.linkedBrowser.docShellIsActive ? "[A]" : ""; + } } |