Skip to content

Add default browser checkbox to download button block#963

Merged
maureenlholland merged 12 commits intomainfrom
WT-643-default-browser-checkbox
Feb 16, 2026
Merged

Add default browser checkbox to download button block#963
maureenlholland merged 12 commits intomainfrom
WT-643-default-browser-checkbox

Conversation

@maribedran
Copy link
Collaborator

@maribedran maribedran commented Feb 10, 2026

One-line summary

Add a new option to the Download Firefox Button block to display a "Set as default browser" checkbox.

Significant changes and points to review

Issue / Bugzilla link

https://mozilla-hub.atlassian.net/browse/WT-643

Testing

  • Run ./manage.py load_page_fixtures
  • Check http://localhost:8000/en-US/tests-index-page/test-buttons-page/ for the download buttons
    • The checkbox should only show on Windows
    • The page's preview should display the checkbox with the preview indicator
  • Check http://localhost:8000/en-US/tests-index-page-2026/test-home-page/ for the same conditions
  • Open the pages in a Windows environment
    • If the button isn't configured to display the checkbox nothing should change with the default stub attribution
    • If the checkbox is set, the ?utm_campaign=SET_DEFAULT_BROWSER query should be added to the URL image
    • Check the cookies and look for moz-stub-attribution-code
    • Decode the base64 value from the cookie. It should look like: source=(not set)&medium=(direct)&campaign=SET_DEFAULT_BROWSER&content=(not set)&experiment=(not set)&variation=(not set)&ua=chrome&client_id_ga4=491504120.1770734695&session_id=3307072354&dlsource=fxdotcom (note the SET_DEFAULT_BROWSER campaign) image
    • Click the download button and check the "Try downloading again" link for the same attribution values image
    • Uncheck the checkbox and verify that the stub attribution value has changed to the default properties. Something like: source=(not set)&medium=(direct)&campaign=(not set)&content=(not set)&experiment=(not set)&variation=(not set)&ua=chrome&client_id_ga4=142934101.1770905600&session_id=8364667907&dlsource=fxdotcom (no SET_DEFAULT_BROWSER` campaign)

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.55%. Comparing base (24d700a) to head (ee941d1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #963      +/-   ##
==========================================
+ Coverage   79.50%   79.55%   +0.04%     
==========================================
  Files         121      121              
  Lines        7154     7169      +15     
==========================================
+ Hits         5688     5703      +15     
  Misses       1466     1466              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maureenlholland maureenlholland self-assigned this Feb 11, 2026
Copy link
Collaborator

@maureenlholland maureenlholland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one blocker around JS running when Wagtail checkbox setting is false

I guess the other difficult thing is this will affect all download buttons on the page, regardless of whether they have a checkbox. Maybe another point in help text?

the UTM param is added to URL and stub attribution cookie is updated for SET_DEFAULT_BROWSER, regardless of which button I press
Image

@maribedran
Copy link
Collaborator Author

@maureenlholland I also included here the fix for the Linux download buttons that should show both 32 and 64 buttons.

@kkellydesign
Copy link
Collaborator

@maureenlholland If you could give this another pass, we can get this merged. Note that Mariana is out next week, so if there are more revisions that are needed, let me know.

@maureenlholland
Copy link
Collaborator

maureenlholland commented Feb 16, 2026

updates resolve previous requested changes ✅

going to look at conflict resolutions
UPDATE: compared the thanks CSS files, there doesn't seem to be a conflict after git merge

DownloadAsDefault.processAttributionRequest(true);
// processAttributionRequest will bind the events
const checkboxes = document.querySelectorAll('.default-browser-checkbox');
if (checkboxes.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@maureenlholland maureenlholland merged commit d123d86 into main Feb 16, 2026
6 checks passed
@maureenlholland maureenlholland deleted the WT-643-default-browser-checkbox branch February 16, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants