Skip to content

Add desktop QR-code button to iOS download page - #1654

Open
slightlyoffbeat wants to merge 4 commits into
mainfrom
danb/iosbutton
Open

Add desktop QR-code button to iOS download page#1654
slightlyoffbeat wants to merge 4 commits into
mainfrom
danb/iosbutton

Conversation

@slightlyoffbeat

Copy link
Copy Markdown
Contributor

One-line summary

Add a desktop-only QR-code button to the iOS download page so visitors who can't install from the App Store link can scan to get Firefox on their phone.

Significant changes and points to review

  • cms/download_page.html (iOS branch only) — This is the main change and the thing to review. The page is shared by all six platform download pages; the change is scoped strictly to the page.platform == "ios" branch. Desktop visitors (windows/osx/linux) now see a "Get it for mobile" button that opens a QR-code modal (fl-dialog); everyone else (ios/android/other) still gets the existing App Store button. Show/hide is the existing conditional-display CSS mechanism keyed off the platform class site.js puts on <html> — both buttons render in the HTML and CSS gates visibility. No new JS/CSS: the modal reuses the Flare dialog (setupDialogs) and QR (qrcode_rounded) already loaded via base-flare.html.
  • Strings — New l10n/en/cms/download.ftl (download-get-it-for-mobile, download-scan-to-get) in the CMS Fluent namespace (scoped to CMS locales), wired via DownloadPage.ftl_files.
  • ⚠️ WIP — placeholder QR. The QR currently encodes the same App Store URL as the button, so scans aren't independently trackable, and it only routes to iOS. Before launch we need to finalize (1) the destination (device-aware /browsers/mobile/ page vs. App Store deep-link) and (2) a QR-specific tracking token. Marked with a TODO (WIP) in the template. Please don't merge until that's resolved.

Testing

  1. Run locally and visit /download/ios.
  2. Desktop: confirm you see the "Get it for mobile" button; click it and confirm the QR-code modal opens and closes.
  3. Simulate other platforms without a device — in DevTools, select the <html> element and edit its class:
    • ios → App Store button shows, QR button hidden.
    • windows / osx / linux → QR button shows, App Store hidden.
    • android / other → App Store button shows (fallback).
  4. Confirm the modal heading reads "Scan to download Firefox on your mobile device" (no "iOS").
  5. Confirm the other platform pages (/download/, /download/android, etc.) are unchanged.

Desktop visitors to /download/ios can't install from the App Store
link, so show a "Get it for mobile" button that opens a QR-code modal
instead. iOS/Android/other visitors still get the App Store button.

QR is a placeholder (WIP): it encodes the App Store URL for now;
destination and unique tracking token to be finalized before launch.
@slightlyoffbeat
slightlyoffbeat marked this pull request as ready for review August 7, 2026 02:59
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.43%. Comparing base (ed6d12d) to head (ab6542d).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1654      +/-   ##
==========================================
+ Coverage   88.15%   88.43%   +0.28%     
==========================================
  Files         167      171       +4     
  Lines       11600    12093     +493     
==========================================
+ Hits        10226    10695     +469     
- Misses       1374     1398      +24     

☔ View full report in Codecov by Harness.
📢 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.

@knowler knowler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar to #1699 (comment), I think we we should include a link alternative for the QR code, since that’d better serve screen reader and keyboard users.

Comment thread springfield/cms/templates/cms/download_page.html

@stephaniehobson stephaniehobson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CSS code change requested to improve maintainability.

Question (non blocking): Why are we only doing this on the iOS page and not the Android one?


/* The QR alt link inherits the base link purple, which is low-contrast on the
white dialog. Match the dialog's own near-black text color instead. */
.fl-qr-code-dialog .fl-qr-code-floating-content a {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Todo (blocking): Please add link color support to the parent .fl-qr-code-dialog where the background and text colours are defined. Also, we don't need a comment if it's done there.

{# Marketing-provided static QR: its destination and tracking token are baked into
the image and maintained by the marketing team, not generated from ios_url. #}
<div class="fl-qr-code-image">
<img src="{{ static('img/firefox/browsers/mobile/ios/qr-code-ios.png') }}" width="740" height="740" alt="">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Todo (blocking): Please add alt text for the QR Code. Screen reader users can still scan codes with their mobile phones if they know there is one. The string download-scan-to-get may work here.

Comment on lines +102 to +103
{# Marketing-provided static QR: its destination and tracking token are baked into
the image and maintained by the marketing team, not generated from ios_url. #}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{# Marketing-provided static QR: its destination and tracking token are baked into
the image and maintained by the marketing team, not generated from ios_url. #}

Thank you Claude, we know what a QR code is and how to maintain it.

Comment on lines +107 to +108
{# Text-link alternative to the QR for keyboard / screen-reader users
and anyone without a phone camera. #}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{# Text-link alternative to the QR for keyboard / screen-reader users
and anyone without a phone camera. #}

Tautological comment is tautological.

</div>
{# Text-link alternative to the QR for keyboard / screen-reader users
and anyone without a phone camera. #}
<a href="{{ url('firefox.browsers.mobile') }}">{{ ftl('download-get-firefox-on-your-phone') }}</a>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Enhancement (non-blocking): Let's change this to something more indicative of where the link goes like: "Download from the App Store" (and if we do it on the Android page: "Download from the Play Store")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants