tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit f66df20fb0b399ca2b4b5e194f2cc62cdba4b9b6
parent 983d1d4f34e4e93002dca7aa50926ec3fdd0fcba
Author: Stephen Thompson <sthompson@mozilla.com>
Date:   Thu, 16 Oct 2025 01:24:57 +0000

Bug 1992300 - update backup HTML file support link r=mconley

added `utm_campaign=fx-backup-restore` based on the profile backup spec

Differential Revision: https://phabricator.services.mozilla.com/D268038

Diffstat:
Mbrowser/components/backup/BackupService.sys.mjs | 1+
Mbrowser/components/backup/tests/xpcshell/test_BackupService_renderTemplate.js | 33+++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/browser/components/backup/BackupService.sys.mjs b/browser/components/backup/BackupService.sys.mjs @@ -1936,6 +1936,7 @@ export class BackupService extends EventTarget { ); supportURI.searchParams.set("utm_medium", "firefox-desktop"); supportURI.searchParams.set("utm_source", "html-backup"); + supportURI.searchParams.set("utm_campaign", "fx-backup-restore"); let supportLink = templateDOM.querySelector("#support-link"); supportLink.href = supportURI.href; diff --git a/browser/components/backup/tests/xpcshell/test_BackupService_renderTemplate.js b/browser/components/backup/tests/xpcshell/test_BackupService_renderTemplate.js @@ -297,3 +297,36 @@ add_task(async function test_no_license() { "The license headers were stripped." ); }); + +/** + * Tests that the "Learn More" support link/SUMO link has the expected UTM + * parameters. + */ +add_task(async function test_support_link_utm_parameters() { + let { backupDOM } = await testRenderTemplate(false /* isEncrypted */); + + let supportLinkElement = backupDOM.getElementById("support-link"); + Assert.ok(supportLinkElement, "support link should be found"); + Assert.ok( + supportLinkElement.href, + "support link should have a non-empty href" + ); + + let supportLinkUrl = new URL(supportLinkElement.href); + let { searchParams } = supportLinkUrl; + Assert.equal( + searchParams.get("utm_medium"), + "firefox-desktop", + "utm_medium should be firefox-desktop" + ); + Assert.equal( + searchParams.get("utm_source"), + "html-backup", + "utm_source should be html-backup" + ); + Assert.equal( + searchParams.get("utm_campaign"), + "fx-backup-restore", + "utm_campaign should be fx-backup-restore" + ); +});