Skip to content

Commit

Permalink
Merge pull request #2300 from kyoshino/bug-1069663-arm-linux
Browse files Browse the repository at this point in the history
Fix Bug 1069663 - mozilla.org treats Ubuntu on ARM as Android
  • Loading branch information
jpetto committed Dec 4, 2014
2 parents 30770f6 + 4e5a956 commit b52bd23
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 4 deletions.
3 changes: 3 additions & 0 deletions bedrock/firefox/templates/firefox/new.html
Expand Up @@ -69,6 +69,9 @@ <h2><img src="{{ MEDIA_URL }}img/firefox/new/header-firefox.png?2013-06" alt="{{
<a href="https://support.mozilla.org/kb/update-firefox-latest-version">{{_('Update to stay fast and safe.')}}</a>
</div>
</div>
<div id="version-message-linux-arm" class="version-message">
{{ _('Please follow <a href="%(url)s">these instructions</a> to install Firefox.')|format(url='https://support.mozilla.org/kb/install-firefox-linux') }}
</div>
</div>
<div id="main-feature">
<div class="row">
Expand Down
3 changes: 3 additions & 0 deletions bedrock/mozorg/templates/mozorg/download_firefox_button.html
Expand Up @@ -33,6 +33,9 @@ <h4>{{ _('Download Firefox') }} — {{ locale_name|safe }}</h4>
<p class="unsupported-download">
{{ _("Your system doesn't meet the <a href=\"%(url)s\">requirements</a> to run Firefox.")|format(url=product_url('firefox', 'sysreq', build)) }}
</p>
<p class="linux-arm-download">
{{ _('Please follow <a href="%(url)s">these instructions</a> to install Firefox.')|format(url='https://support.mozilla.org/kb/install-firefox-linux') }}
</p>
{% endif %}
<ul class="download-list">
{% for plat in builds %}
Expand Down
30 changes: 30 additions & 0 deletions media/css/firefox/new.less
Expand Up @@ -271,6 +271,36 @@ html.fxos {
}
}

/* Linux on ARM processors */
.linux.arm {
.version-message-container {
display: block;
}

#version-message-linux-arm {
display: inline;
}

#theater-firefox,
#stage-firefox,
#scene1 {
position: relative;
height: auto;
}

#version-message-desktop-latest,
#version-message-desktop-old,
#features-download {
display: none;
}

/* hide the newsletter box while keeping the height of the screenshot */
#newsletter-latest {
display: block;
visibility: hidden;
}
}

#main-feature {
margin-top: 14px;
padding-bottom: 20px;
Expand Down
3 changes: 3 additions & 0 deletions media/css/sandstone/buttons.less
Expand Up @@ -256,6 +256,7 @@

// Product download buttons

.download-button .linux-arm-download,
.download-button .unrecognized-download,
.download-button .unsupported-download {
display: none;
Expand Down Expand Up @@ -530,6 +531,7 @@

.download-button .os_linux,
.download-button .os_linux64,
.linux.arm .download-button .os_linux,
.linux.x86.x64 .download-list .os_linux,
.download-button .os_windows,
.download-button .os_osx,
Expand All @@ -553,6 +555,7 @@
display: block !important;
}

.linux.arm .download-button .linux-arm-download,
.ios .download-button .unsupported-download,
.oldwin .download-button .unsupported-download,
.oldmac .download-button .unsupported-download {
Expand Down
9 changes: 5 additions & 4 deletions media/js/base/site.js
Expand Up @@ -41,10 +41,7 @@
if (/android/i.test(ua)) {
return 'android';
}
if (/armv[6-7]l/.test(pf)) {
return 'android';
}
if (pf.indexOf("Linux") !== -1) {
if (/linux/i.test(pf) || /linux/i.test(ua)) {
return 'linux';
}
if (pf.indexOf("MacPPC") !== -1) {
Expand Down Expand Up @@ -138,6 +135,10 @@
var archSize = window.site.archSize = window.site.getArchSize();
if (archType !== 'x86') {
h.className = h.className.replace('x86', archType);

if (/armv\d+/.test(archType)) {
h.className += ' arm';
}
}
if (archSize === 64) {
h.className += ' x64';
Expand Down
3 changes: 3 additions & 0 deletions media/js/test/spec/site.js
Expand Up @@ -21,6 +21,7 @@ describe("site.js", function () {

it("should identify Linux", function () {
expect(window.site.getPlatform('foo', 'Linux')).toBe('linux');
expect(window.site.getPlatform('Mozilla/5.0 (X11; Ubuntu; Linux armv7l; rv:32.0) Gecko/20100101 Firefox/32.0', 'Linux armv7l')).toBe('linux');
});

it("should identify old-Mac", function () {
Expand Down Expand Up @@ -63,6 +64,7 @@ describe("site.js", function () {
it("should identify ARM", function () {
expect(window.site.getArchType('Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0', 'Linux armv7l')).toBe('armv7');
expect(window.site.getArchType('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1b2pre) Gecko/20081116 Fennec/1.0a2pre', 'Linux armv6l')).toBe('armv6');
expect(window.site.getArchType('Mozilla/5.0 (X11; Ubuntu; Linux armv7l; rv:32.0) Gecko/20100101 Firefox/32.0', 'Linux armv7l')).toBe('armv7');
});

it("should identify PowerPC", function () {
Expand All @@ -83,6 +85,7 @@ describe("site.js", function () {
expect(window.site.getArchSize('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:27.0) Gecko/20100101 Firefox/27.0', 'MacIntel')).toBe(32);
expect(window.site.getArchSize('Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:27.0) Gecko/20100101 Firefox/27.0', 'Linux i686')).toBe(32);
expect(window.site.getArchSize('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1b2pre) Gecko/20081116 Fennec/1.0a2pre', 'Linux armv6l')).toBe(32);
expect(window.site.getArchSize('Mozilla/5.0 (X11; Ubuntu; Linux armv7l; rv:32.0) Gecko/20100101 Firefox/32.0', 'Linux armv7l')).toBe(32);
});
});
});

0 comments on commit b52bd23

Please sign in to comment.