Loading browser/components/BrowserGlue.sys.mjs +1 −0 Original line number Diff line number Diff line Loading @@ -453,6 +453,7 @@ let JSWINDOWACTORS = { events: { DOMContentLoaded: {}, SubmitSearchOnionize: { wantUntrusted: true }, YECHidden: { wantUntrusted: true }, }, }, Loading browser/components/abouttor/AboutTorChild.sys.mjs +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ export class AboutTorChild extends JSWindowActorChild { case "SubmitSearchOnionize": this.sendAsyncMessage("AboutTor:SetSearchOnionize", !!event.detail); break; case "YECHidden": // YEC 2023 banner was closed. Persist this for the rest of this // session. See tor-browser#42188. this.sendAsyncMessage("AboutTor:HideYEC"); break; } } } browser/components/abouttor/AboutTorParent.sys.mjs +17 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,19 @@ ChromeUtils.defineESModuleGetters(lazy, { TorConnect: "resource:///modules/TorConnect.sys.mjs", }); /** * Whether we should hide the Year end campaign (YEC) 2023 donation banner for * new about:tor pages. Applied to all future about:tor pages within this * session (i.e. new tabs, new windows, and after new identity). * * Will reset back to shown at the next full restart. * * See tor-browser#42188. * * @type {boolean} */ let hideYEC = false; export class AboutTorParent extends JSWindowActorParent { receiveMessage(message) { const onionizePref = "torbrowser.homepage.search.onionize"; Loading @@ -22,10 +35,14 @@ export class AboutTorParent extends JSWindowActorParent { Services.locale.appLocaleAsBCP47 === "ja-JP-macos" ? "ja" : Services.locale.appLocaleAsBCP47, hideYEC, }); case "AboutTor:SetSearchOnionize": Services.prefs.setBoolPref(onionizePref, message.data); break; case "AboutTor:HideYEC": hideYEC = true; break; } return undefined; } Loading browser/components/abouttor/content/aboutTor.js +4 −2 Original line number Diff line number Diff line Loading @@ -200,6 +200,7 @@ const YecWidget = { this.isActive = now >= yecStart && now < yecEnd; document.getElementById("yec-2023-close").addEventListener("click", () => { dispatchEvent(new CustomEvent("YECHidden", { bubbles: true })); this.isOpen = false; }); Loading @@ -215,7 +216,7 @@ const YecWidget = { _isStable: false, _isActive: false, _isOpen: true, _isOpen: false, /** * Whether this is a stable release. Loading Loading @@ -294,7 +295,8 @@ window.addEventListener("DOMContentLoaded", () => { }); window.addEventListener("InitialData", event => { const { appLocale, isStable } = event.detail; const { appLocale, isStable, hideYEC } = event.detail; YecWidget.setDonateLocale(appLocale); YecWidget.isStable = isStable; YecWidget.isOpen = !hideYEC; }); Loading
browser/components/BrowserGlue.sys.mjs +1 −0 Original line number Diff line number Diff line Loading @@ -453,6 +453,7 @@ let JSWINDOWACTORS = { events: { DOMContentLoaded: {}, SubmitSearchOnionize: { wantUntrusted: true }, YECHidden: { wantUntrusted: true }, }, }, Loading
browser/components/abouttor/AboutTorChild.sys.mjs +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ export class AboutTorChild extends JSWindowActorChild { case "SubmitSearchOnionize": this.sendAsyncMessage("AboutTor:SetSearchOnionize", !!event.detail); break; case "YECHidden": // YEC 2023 banner was closed. Persist this for the rest of this // session. See tor-browser#42188. this.sendAsyncMessage("AboutTor:HideYEC"); break; } } }
browser/components/abouttor/AboutTorParent.sys.mjs +17 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,19 @@ ChromeUtils.defineESModuleGetters(lazy, { TorConnect: "resource:///modules/TorConnect.sys.mjs", }); /** * Whether we should hide the Year end campaign (YEC) 2023 donation banner for * new about:tor pages. Applied to all future about:tor pages within this * session (i.e. new tabs, new windows, and after new identity). * * Will reset back to shown at the next full restart. * * See tor-browser#42188. * * @type {boolean} */ let hideYEC = false; export class AboutTorParent extends JSWindowActorParent { receiveMessage(message) { const onionizePref = "torbrowser.homepage.search.onionize"; Loading @@ -22,10 +35,14 @@ export class AboutTorParent extends JSWindowActorParent { Services.locale.appLocaleAsBCP47 === "ja-JP-macos" ? "ja" : Services.locale.appLocaleAsBCP47, hideYEC, }); case "AboutTor:SetSearchOnionize": Services.prefs.setBoolPref(onionizePref, message.data); break; case "AboutTor:HideYEC": hideYEC = true; break; } return undefined; } Loading
browser/components/abouttor/content/aboutTor.js +4 −2 Original line number Diff line number Diff line Loading @@ -200,6 +200,7 @@ const YecWidget = { this.isActive = now >= yecStart && now < yecEnd; document.getElementById("yec-2023-close").addEventListener("click", () => { dispatchEvent(new CustomEvent("YECHidden", { bubbles: true })); this.isOpen = false; }); Loading @@ -215,7 +216,7 @@ const YecWidget = { _isStable: false, _isActive: false, _isOpen: true, _isOpen: false, /** * Whether this is a stable release. Loading Loading @@ -294,7 +295,8 @@ window.addEventListener("DOMContentLoaded", () => { }); window.addEventListener("InitialData", event => { const { appLocale, isStable } = event.detail; const { appLocale, isStable, hideYEC } = event.detail; YecWidget.setDonateLocale(appLocale); YecWidget.isStable = isStable; YecWidget.isOpen = !hideYEC; });