Loading browser/components/tabbrowser/content/tabbrowser.js +1 −0 Changes for browser/components/tabbrowser/content/tabbrowser.js: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7968,6 +7968,7 @@ var StatusPanel = { if (XULBrowserWindow.busyUI) { types.push("status"); } types.push("letterboxingStatus"); types.push("defaultStatus"); for (type of types) { if ((text = XULBrowserWindow[type])) { Loading browser/themes/shared/tabbrowser/content-area.css +18 −0 Changes for browser/themes/shared/tabbrowser/content-area.css: 18 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ min-width: min(23em, 33%); } &[type=letterboxingStatus], &[type=overLink] { transition: opacity 120ms ease-out, visibility 120ms; } Loading @@ -149,12 +150,14 @@ direction: ltr; } .exclude-letterboxing &[type=letterboxingStatus], &[inactive], :root[inDOMFullscreen] &:not([type=overLink]) { transition: none; opacity: 0; visibility: hidden; &[previoustype=letterboxingStatus], &[previoustype=overLink] { transition: opacity 200ms ease-out, visibility 200ms; } Loading Loading @@ -203,6 +206,21 @@ } } #statuspanel[type=letterboxingStatus] > #statuspanel-label, #statuspanel[previoustype=letterboxingStatus][inactive] > #statuspanel-label { background-image: url("chrome://browser/skin/window.svg"); background-size: 1em; background-repeat: no-repeat; background-position-x: .5em; background-position-y: center; padding-inline-start: 2em; -moz-context-properties: fill; fill: var(--color-accent-primary); @media (forced-colors) { fill: var(--icon-color); } } /** * Shortcuts */ Loading toolkit/components/resistfingerprinting/RFPHelper.sys.mjs +30 −5 Changes for toolkit/components/resistfingerprinting/RFPHelper.sys.mjs: 30 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ class _RFPHelper { switch (aMessage.type) { case "TabOpen": { let browser = aMessage.target.linkedBrowser; this._roundOrResetContentSize(browser, /* isNewTab = */ true); this._roundOrResetContentSize(browser, { isNewTab: true }); browser.ownerGlobal._rfpResizeObserver.observe(browser.parentElement); break; } Loading Loading @@ -480,7 +480,7 @@ class _RFPHelper { ); } _roundOrResetContentSize(aBrowser, isNewTab = false) { _roundOrResetContentSize(aBrowser, context = {}) { // We won't do anything for lazy browsers. if (!aBrowser?.isConnected) { return; Loading @@ -489,7 +489,7 @@ class _RFPHelper { // this tab doesn't need letterboxing this._resetContentSize(aBrowser); } else { this._roundContentSize(aBrowser, isNewTab); this._roundContentSize(aBrowser, context); } } Loading @@ -515,7 +515,8 @@ class _RFPHelper { /** * The function will round the given browser size */ async _roundContentSize(aBrowser, isNewTab = false) { async _roundContentSize(aBrowser, context) { const { isResize, isNewTab } = context; let logPrefix = `_roundContentSize[${Math.random()}]`; log(logPrefix); let win = aBrowser.ownerGlobal; Loading Loading @@ -687,6 +688,26 @@ class _RFPHelper { borderRadius === 0 ? "hidden" : "", "--letterboxing-border-radius": borderRadius, }); if ( isResize && this.letterboxingEnabled && (parentWidth > lastRoundedSize.width || parentHeight > lastRoundedSize.height) ) { const updateStatus = async args => { win.XULBrowserWindow.letterboxingStatus = args ? await win.document.l10n.formatValue( "letterboxing-size-status", args ) : ""; win.StatusPanel.update(); }; updateStatus(lastRoundedSize); win.clearTimeout(win._letterboxingStatusTimeout); win._letterboxingStatusTimeout = win.setTimeout(updateStatus, 1000); } } // If the size of the content is already quantized, we do nothing. Loading Loading @@ -789,8 +810,12 @@ class _RFPHelper { aWindow.addEventListener("TabOpen", this); const resizeObserver = (aWindow._rfpResizeObserver = new aWindow.ResizeObserver(entries => { const context = { isResize: true }; for (let { target } of entries) { this._roundOrResetContentSize(target.querySelector("browser")); this._roundOrResetContentSize( target.querySelector("browser"), context ); } })); // observe resizing of each browser's parent (gets rid of RPC from content windows) Loading Loading
browser/components/tabbrowser/content/tabbrowser.js +1 −0 Changes for browser/components/tabbrowser/content/tabbrowser.js: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7968,6 +7968,7 @@ var StatusPanel = { if (XULBrowserWindow.busyUI) { types.push("status"); } types.push("letterboxingStatus"); types.push("defaultStatus"); for (type of types) { if ((text = XULBrowserWindow[type])) { Loading
browser/themes/shared/tabbrowser/content-area.css +18 −0 Changes for browser/themes/shared/tabbrowser/content-area.css: 18 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ min-width: min(23em, 33%); } &[type=letterboxingStatus], &[type=overLink] { transition: opacity 120ms ease-out, visibility 120ms; } Loading @@ -149,12 +150,14 @@ direction: ltr; } .exclude-letterboxing &[type=letterboxingStatus], &[inactive], :root[inDOMFullscreen] &:not([type=overLink]) { transition: none; opacity: 0; visibility: hidden; &[previoustype=letterboxingStatus], &[previoustype=overLink] { transition: opacity 200ms ease-out, visibility 200ms; } Loading Loading @@ -203,6 +206,21 @@ } } #statuspanel[type=letterboxingStatus] > #statuspanel-label, #statuspanel[previoustype=letterboxingStatus][inactive] > #statuspanel-label { background-image: url("chrome://browser/skin/window.svg"); background-size: 1em; background-repeat: no-repeat; background-position-x: .5em; background-position-y: center; padding-inline-start: 2em; -moz-context-properties: fill; fill: var(--color-accent-primary); @media (forced-colors) { fill: var(--icon-color); } } /** * Shortcuts */ Loading
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs +30 −5 Changes for toolkit/components/resistfingerprinting/RFPHelper.sys.mjs: 30 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ class _RFPHelper { switch (aMessage.type) { case "TabOpen": { let browser = aMessage.target.linkedBrowser; this._roundOrResetContentSize(browser, /* isNewTab = */ true); this._roundOrResetContentSize(browser, { isNewTab: true }); browser.ownerGlobal._rfpResizeObserver.observe(browser.parentElement); break; } Loading Loading @@ -480,7 +480,7 @@ class _RFPHelper { ); } _roundOrResetContentSize(aBrowser, isNewTab = false) { _roundOrResetContentSize(aBrowser, context = {}) { // We won't do anything for lazy browsers. if (!aBrowser?.isConnected) { return; Loading @@ -489,7 +489,7 @@ class _RFPHelper { // this tab doesn't need letterboxing this._resetContentSize(aBrowser); } else { this._roundContentSize(aBrowser, isNewTab); this._roundContentSize(aBrowser, context); } } Loading @@ -515,7 +515,8 @@ class _RFPHelper { /** * The function will round the given browser size */ async _roundContentSize(aBrowser, isNewTab = false) { async _roundContentSize(aBrowser, context) { const { isResize, isNewTab } = context; let logPrefix = `_roundContentSize[${Math.random()}]`; log(logPrefix); let win = aBrowser.ownerGlobal; Loading Loading @@ -687,6 +688,26 @@ class _RFPHelper { borderRadius === 0 ? "hidden" : "", "--letterboxing-border-radius": borderRadius, }); if ( isResize && this.letterboxingEnabled && (parentWidth > lastRoundedSize.width || parentHeight > lastRoundedSize.height) ) { const updateStatus = async args => { win.XULBrowserWindow.letterboxingStatus = args ? await win.document.l10n.formatValue( "letterboxing-size-status", args ) : ""; win.StatusPanel.update(); }; updateStatus(lastRoundedSize); win.clearTimeout(win._letterboxingStatusTimeout); win._letterboxingStatusTimeout = win.setTimeout(updateStatus, 1000); } } // If the size of the content is already quantized, we do nothing. Loading Loading @@ -789,8 +810,12 @@ class _RFPHelper { aWindow.addEventListener("TabOpen", this); const resizeObserver = (aWindow._rfpResizeObserver = new aWindow.ResizeObserver(entries => { const context = { isResize: true }; for (let { target } of entries) { this._roundOrResetContentSize(target.querySelector("browser")); this._roundOrResetContentSize( target.querySelector("browser"), context ); } })); // observe resizing of each browser's parent (gets rid of RPC from content windows) Loading