Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions media/css/cms/pages/flare26-channels.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ ul.download-list strong {
display: block !important;
}

.windows .force-win64 .os_win,
.windows .force-win64-aarch64 .os_win {
display: none !important;
}

.windows .force-win64 .os_win64 {
display: block !important;
}

.windows .force-win64-aarch64 .os_win64-aarch64 {
display: block !important;
}

/* add spacing between displayed buttons */
.download-list {
display: grid;
Expand Down
13 changes: 13 additions & 0 deletions media/css/protocol/components/_download-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ ul.download-list {
display: block !important;
}

.windows .force-win64 .os_win,
.windows .force-win64-aarch64 .os_win {
display: none !important;
}

.windows .force-win64 .os_win64 {
display: block !important;
}

.windows .force-win64-aarch64 .os_win64-aarch64 {
display: block !important;
}

// add spacing between displayed buttons
.download-list {
display: grid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{# ESR download buttons to display on unsupported systems: issue 13317 #}
{% include 'firefox/includes/download-unsupported.html' %}
{% endif %}
<ul class="download-list fl-download-list">
<ul class="download-list fl-download-list{%if force_arch %} force-{{ force_arch }}{% endif %}">
{% for plat in builds %}
<li class="os_{{ plat.os }}{% if plat.arch %} {{ plat.arch }}{% endif %}">
<a class="download-link button {{ button_class }} fl-button mzp-c-button mzp-t-product ga-product-download"
Expand Down
2 changes: 1 addition & 1 deletion springfield/firefox/templates/firefox/installer-help.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h1 class="mzp-c-callout-title">{{ ftl('installer-help-page-title') }}</h1>
<section class="installer-channel-card mzp-c-card mzp-c-card-extra-small">
<img src="{{ static(channel_logo) }}" alt="{{ ftl('installer-help-firefox-release-title') }}" width="347" height="64">
<div class="mzp-c-card-content">
{{ download_firefox(installer_channel, platform='desktop', force_direct=True, force_full_installer=True, locale=installer_lang, button_class='mzp-t-md', alt_copy=ftl('download-button-download-now')) }}
{{ download_firefox(installer_channel, platform='desktop', force_direct=True, force_full_installer=True, locale=installer_lang, button_class='mzp-t-md', alt_copy=ftl('download-button-download-now'), force_arch=installer_arch) }}
</div>
</section>
{% else %}
Expand Down
12 changes: 2 additions & 10 deletions springfield/firefox/templatetags/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ def desktop_builds(
for plat_os, plat_os_pretty in firefox_desktop.platforms(channel, classified):
os_pretty = plat_os_pretty

# Firefox Nightly: The Windows stub installer is now universal,
# automatically detecting a 32-bit and 64-bit desktop, so the
# win64-specific entry can be skipped.
if channel == "nightly":
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.

@stevejalim do you know if this special casing is still necessary (related tests here: https://github.com/mozmeao/springfield/pull/1152/changes#diff-787fdc6db4abb92a972f332cdf45bf50fbe8d61618b74f507a937285e8ff6139L173)

More detail in comments: #1152 (comment)

Copy link
Copy Markdown
Collaborator Author

@bluewave41 bluewave41 Apr 13, 2026

Choose a reason for hiding this comment

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

Keeping this behavior makes it confusing and would make the CSS look worse

Release
installer_arch=1? show .win
installer_arch=2? show .win64
installer_arch=3? show .win64-aarch64

Nightly
installer_arch=1? show .win
installer_arch=2? show nothing. win64 sets the platform to win but arch 2 shows win64 which doesn't exist
installer_arch=3? show .win64-aarch64

So now we need to specifically CSS nightly and show .win for forced arch 1 and 2. This also means you can't get a 64 bit installer for nightly from this page despite one existing. The stub installers are universal but these full installers are different

https://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-central/firefox-151.0a1.en-US.win32.installer.exe
https://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-central/firefox-151.0a1.en-US.win64.installer.exe

matthew:~/Downloads$ md5sum '/home/matthew/Downloads/firefox-151.0a1.en-US.win64.installer.exe' 
a662d6d7a3d2f19f4d638bf57a5b90bd  /home/matthew/Downloads/firefox-151.0a1.en-US.win64.installer.exe
matthew:~/Downloads$ md5sum '/home/matthew/Downloads/firefox-151.0a1.en-US.win32.installer.exe' 
0140dd3abcbb070f8889d4d8b83fc653  /home/matthew/Downloads/firefox-151.0a1.en-US.win32.installer.exe

if plat_os == "win":
continue
if plat_os == "win64":
plat_os = "win"
os_pretty = "Windows 32/64-bit"

# And generate all the info
download_link = firefox_desktop.get_download_url(
channel,
Expand Down Expand Up @@ -114,6 +104,7 @@ def download_firefox(
button_class="mzp-t-xl",
locale_in_transition=False,
download_location=None,
force_arch=None,
):
"""Output a "download firefox" button.

Expand Down Expand Up @@ -171,6 +162,7 @@ def download_firefox(
"button_class": button_class,
"download_location": download_location,
"fluent_l10n": ctx["fluent_l10n"],
"force_arch": force_arch,
}

html = render_to_string("firefox/includes/download-button.html", data, request=ctx["request"])
Expand Down
1 change: 1 addition & 0 deletions springfield/firefox/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ def test_one_button_when_channel_specified(self):
force_full_installer=True,
locale=None,
platform="desktop",
force_arch=None,
)
28 changes: 0 additions & 28 deletions springfield/firefox/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,34 +170,6 @@ def test_button_has_data_attr_if_not_direct(self):
# The 10th link is mobile and should not have the attr
assert pq(links[9]).attr("data-direct-link") is None

def test_nightly_desktop(self):
"""
The Nightly channel should have the Windows universal stub installer
instead of the Windows 64-bit build
"""
rf = RequestFactory()
get_request = rf.get("/fake")
get_request.locale = "fr"
doc = pq(
render(
"{{ download_firefox('nightly', platform='desktop') }}", {"request": get_request, "fluent_l10n": self.get_l10n(get_request.locale)}
)
)

list = doc(".download-list li")
assert list.length == 8
assert pq(list[0]).attr("class") == "os_win"
assert pq(list[1]).attr("class") == "os_win64-msi"
assert pq(list[2]).attr("class") == "os_win64-aarch64"
assert pq(list[3]).attr("class") == "os_win-msi"
assert pq(list[4]).attr("class") == "os_osx"
assert pq(list[5]).attr("class") == "os_linux64"
assert pq(list[6]).attr("class") == "os_linux64-aarch64"
assert pq(list[7]).attr("class") == "os_linux"
# stub disabled for now for non-en-US locales
# bug 1339870
# assert 'stub' in pq(pq(list[1]).find('a')[0]).attr('href')

def test_aurora_desktop(self):
"""The Aurora channel should have Windows 64 build"""
rf = RequestFactory()
Expand Down
5 changes: 5 additions & 0 deletions springfield/firefox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
installer_lang = self.request.GET.get("installer_lang", None)
installer_channel = self.request.GET.get("channel", None)
installer_arch = self.request.GET.get("installer_arch", None)
ctx["installer_lang"] = None
ctx["installer_channel"] = None
ctx["installer_arch"] = None

if installer_arch is not None:
ctx["installer_arch"] = {"1": "win", "2": "win64", "3": "win64-aarch64"}[installer_arch]

if installer_lang and installer_lang in firefox_desktop.languages:
ctx["installer_lang"] = installer_lang
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,68 @@ test.describe(
await expect(downloadButtonBeta).not.toBeVisible();
await expect(downloadButtonDeveloper).not.toBeVisible();
});

test('Download Firefox (Windows) forced win architecture', async ({
page,
browserName
}) => {
const downloadButtonRelease = page.getByTestId(
'download-button-desktop-release-win'
);

test.skip(
browserName === 'webkit',
'Safari not available on Windows'
);

await openPage(
url + '?channel=release&installer_arch=1',
page,
browserName
);
await expect(downloadButtonRelease).toBeVisible();
});

test('Download Firefox (Windows) forced win64 architecture', async ({
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.

non-blocking is it also worth checking the unexpected win downloads are not visible?

page,
browserName
}) => {
const downloadButtonRelease = page.getByTestId(
'download-button-desktop-release-win64'
);

test.skip(
browserName === 'webkit',
'Safari not available on Windows'
);

await openPage(
url + '?channel=release&installer_arch=2',
page,
browserName
);
await expect(downloadButtonRelease).toBeVisible();
});

test('Download Firefox (Windows) forced win64-aarch64 architecture', async ({
page,
browserName
}) => {
const downloadButtonRelease = page.getByTestId(
'download-button-desktop-release-win64-aarch64'
);

test.skip(
browserName === 'webkit',
'Safari not available on Windows'
);

await openPage(
url + '?channel=release&installer_arch=3',
page,
browserName
);
await expect(downloadButtonRelease).toBeVisible();
});
}
);
Loading