Remove mozillaonline integrations

This commit is contained in:
Alex Gibson 2024-04-30 09:32:06 +01:00
Родитель 9553c3dc9a
Коммит 04ff39607e
19 изменённых файлов: 11 добавлений и 94 удалений

Просмотреть файл

@ -48,7 +48,7 @@
{% macro google_play_button(class_name='', extra_data_attributes={}, extra_img_attributes={}, href=settings.GOOGLE_PLAY_FIREFOX_LINK_UTMS, id='', product='Firefox', target='') -%}
{% set optional_img_attributes = {'alt': ftl('download-button-google-play'), 'width': '152', 'height': '45', 'l10n': True} %}
{% do optional_img_attributes.update(extra_img_attributes) %}
<a class="ga-product-download {{ class_name }}"{% if id %} id="{{ id }}"{% endif %}{% if target %} target="{{ target }}" rel="external noopener noreferrer"{% else %} rel="external"{% endif %} href="{{ href }}"{% if product in ['Firefox', 'Focus'] %} data-link-type="download" data-download-os="Android"{% endif %}{% if product == 'Firefox' %} data-mozillaonline-link="{{ settings.GOOGLE_PLAY_FIREFOX_LINK_MOZILLAONLINE }}"{% endif %}{% for attr, val in extra_data_attributes.items() %} data-{{ attr }}="{{ val }}"{% endfor %}>
<a class="ga-product-download {{ class_name }}"{% if id %} id="{{ id }}"{% endif %}{% if target %} target="{{ target }}" rel="external noopener noreferrer"{% else %} rel="external"{% endif %} href="{{ href }}"{% if product in ['Firefox', 'Focus'] %} data-link-type="download" data-download-os="Android"{% endif %}{% for attr, val in extra_data_attributes.items() %} data-{{ attr }}="{{ val }}"{% endfor %}>
{{ resp_img(
url='img/firefox/android/btn-google-play.png',
srcset={

Просмотреть файл

@ -40,7 +40,7 @@
{% else %}
<p>{{ ftl('firefox-mobile-scan-the-qr-code-to-get-started') }}</p>
<div class="qr-code-wrapper">
<img src="{{ static('img/firefox/browsers/mobile/qrcode-firefox-browsers-mobile-get-app.png') }}" id="firefox-qr" data-mozillaonline-link="{{ static('img/firefox/browsers/mobile/qr-firefox-mozillaonline.png') }}" alt="" width="350" height="350">
<img src="{{ static('img/firefox/browsers/mobile/qrcode-firefox-browsers-mobile-get-app.png') }}" id="firefox-qr" alt="" width="350" height="350">
</div>
{% endif %}
</section>

Просмотреть файл

@ -14,9 +14,7 @@
{% else %}
<p class="c-inline-form-body">{{ ftl('mobile-android-scan-the-qr-code-to-get-started') }}</p>
<div class="qr-code-wrapper">
<img src="{{ static('img/firefox/browsers/mobile/qrcode-firefox-browsers-mobile-android.png') }}" width="400" height="400" id="firefox-qr"
data-mozillaonline-link="{{ static('img/firefox/browsers/mobile/qr-firefox-mozillaonline.png') }}"
alt="{{ ftl('mobile-android-scan-alt-text') }}">
<img src="{{ static('img/firefox/browsers/mobile/qrcode-firefox-browsers-mobile-android.png') }}" width="400" height="400" id="firefox-qr" alt="{{ ftl('mobile-android-scan-alt-text') }}">
</div>
{% endif %}
</div>

Просмотреть файл

@ -14,9 +14,7 @@
{% else %}
<p class="c-inline-form-body">{{ ftl('mobile-ios-scan-the-qr-code-to-get-started') }}</p>
<div class="qr-code-wrapper">
<img src="{{ static('img/firefox/browsers/mobile/qrcode-firefox-browsers-mobile-ios.png') }}" width="400" height="400" id="firefox-qr"
data-mozillaonline-link="{{ static('img/firefox/browsers/mobile/qr-firefox-mozillaonline.png') }}"
alt="{{ ftl('mobile-ios-scan-alt-text') }}">
<img src="{{ static('img/firefox/browsers/mobile/qrcode-firefox-browsers-mobile-ios.png') }}" width="400" height="400" id="firefox-qr" alt="{{ ftl('mobile-ios-scan-alt-text') }}">
</div>
{% endif %}
</div>

Просмотреть файл

@ -56,7 +56,6 @@
<div class="qr-code-wrapper">
<img src="{{ static('img/firefox/welcome/qrcode-firefox-welcome-6.png') }}"
id="firefox-qr"
data-mozillaonline-link="{{ static('img/firefox/browsers/mobile/qr-firefox-mozillaonline.png') }}"
alt="{{ ftl('welcome-page6-qr-code-to-scan-for-firefox') }}">
</div>
{% endif %}

Просмотреть файл

@ -66,7 +66,7 @@
</div>
{% else %}
<div id="qr-wrapper" class="primary-cta">
<img src="{{ static('img/firefox/whatsnew/qrcode-firefox-whatsnew.png') }}" data-mozillaonline-link="{{ static('img/firefox/whatsnew/qrcode-mozillaonline.png') }}" width="250" height="250" alt="{{ ftl('whatsnew-account-qr-code-alt') }}">
<img src="{{ static('img/firefox/whatsnew/qrcode-firefox-whatsnew.png') }}" width="250" height="250" alt="{{ ftl('whatsnew-account-qr-code-alt') }}">
</div>
{% endif %}
</div>

Просмотреть файл

@ -50,7 +50,7 @@
</div>
{% else %}
<div id="qr-wrapper" class="primary-cta">
<img src="{{ static('img/firefox/whatsnew/qrcode-firefox-whatsnew.png') }}" data-mozillaonline-link="{{ static('img/firefox/whatsnew/qrcode-mozillaonline.png') }}" width="250" height="250" alt="">
<img src="{{ static('img/firefox/whatsnew/qrcode-firefox-whatsnew.png') }}" width="250" height="250" alt="">
</div>
{% endif %}
</div>

Просмотреть файл

@ -119,7 +119,7 @@
<p class="wnp-main-tagline">{{ ftl('whatsnew-s2d-you-got-it-get-firefox-for') }}</p>
<div id="qr-wrapper">
<img src="{{ static('img/firefox/whatsnew/whatsnew122/qrcode-firefox-whatsnew-122.png') }}" data-mozillaonline-link="{{ static('img/firefox/whatsnew/qrcode-mozillaonline.png') }}" width="250" height="250" alt="{{ ftl('whatsnew-account-qr-code-alt') }}">
<img src="{{ static('img/firefox/whatsnew/whatsnew122/qrcode-firefox-whatsnew-122.png') }}" width="250" height="250" alt="{{ ftl('whatsnew-account-qr-code-alt') }}">
</div>
</div>
</div>

Просмотреть файл

@ -206,7 +206,6 @@ else:
"trackertest.org", # mozilla service for tracker detection
"www.surveygizmo.com",
"accounts.firefox.com",
"accounts.firefox.com.cn",
"www.youtube.com",
"js.stripe.com",
]

Просмотреть файл

@ -13,9 +13,6 @@ GOOGLE_PLAY_FIREFOX_LINK = "https://play.google.com/store/apps/details?id=org.mo
# key/values (https://bugzilla.mozilla.org/show_bug.cgi?id=1099429#c0).
GOOGLE_PLAY_FIREFOX_LINK_UTMS = GOOGLE_PLAY_FIREFOX_LINK + "&referrer=" + quote("utm_source=mozilla&utm_medium=Referral&utm_campaign=mozilla-org")
# Bug 1264843, Issue 13108: link to China build of Fx4A, for display within Fx China repack
GOOGLE_PLAY_FIREFOX_LINK_MOZILLAONLINE = "https://www.firefox.com.cn/mobile/get-app/"
# Link to Firefox for iOS on the Apple App Store.
APPLE_APPSTORE_FIREFOX_LINK = "https://apps.apple.com/{country}/app/apple-store/id989804926"

Просмотреть файл

@ -883,7 +883,6 @@ from .appstores import ( # noqa: E402, F401
APPLE_APPSTORE_POCKET_LINK,
GOOGLE_PLAY_FIREFOX_BETA_LINK,
GOOGLE_PLAY_FIREFOX_LINK,
GOOGLE_PLAY_FIREFOX_LINK_MOZILLAONLINE,
GOOGLE_PLAY_FIREFOX_LINK_UTMS,
GOOGLE_PLAY_FIREFOX_NIGHTLY_LINK,
GOOGLE_PLAY_FIREFOX_SEND_LINK,

Просмотреть файл

@ -263,10 +263,8 @@ Firefox Sync and UITour
Since Firefox 80 the accounts link and email form macros use :ref:`UITour<ui-tour>` to show the
Mozilla accounts page and log the browser into Sync or an account. For non-Firefox browsers or if
UITour is not available, the flow uses normal links that allow users to log into the Mozilla accounts
website only, without connecting the Firefox Desktop client. This UITour flow allows the Firefox browser
to determine the correct Mozilla accounts server and authentication flow (this includes handling the
China Repack build of Firefox). This transition was introduced to later migrate Firefox Desktop to an
OAuth based client authentication flow.
website only, without connecting the Firefox Desktop client. This transition was introduced to later
migrate Firefox Desktop to an OAuth based client authentication flow.
The script that handles this logic is ``/media/js/base/fxa-link.js``, and will automatically apply
to any link with a ``js-fxa-cta-link`` class name. The current code automatically detects if you are in the

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 430 B

Просмотреть файл

@ -16,18 +16,6 @@
utils.initMobileDownloadLinks();
utils.trackDownloadThanksButton();
/* Bug 1264843: In partner distribution of desktop Firefox, switch the
downloads to corresponding partner build of Firefox for Android. */
if (typeof Mozilla.Client !== 'undefined') {
var client = Mozilla.Client;
if (client.isFirefoxDesktop) {
client.getFirefoxDetails(
utils.maybeSwitchToChinaRepackImages
);
}
}
});
}

Просмотреть файл

@ -8,8 +8,7 @@ const FxaLink = {};
const client = Mozilla.Client;
const allowedList = [
'https://accounts.firefox.com/',
'https://accounts.stage.mozaws.net/',
'https://accounts.firefox.com.cn/'
'https://accounts.stage.mozaws.net/'
];
/**

Просмотреть файл

@ -7,7 +7,6 @@
const FxaProductButton = {};
const allowedList = [
'https://accounts.firefox.com.cn/',
'https://accounts.firefox.com/',
'https://accounts.stage.mozaws.net/',
'https://getpocket.com/',

Просмотреть файл

@ -107,31 +107,6 @@ if (typeof window.Mozilla === 'undefined') {
}
};
// Bug 1264843: link to China build of Fx4A, for display within Fx China repack
Utils.maybeSwitchToChinaRepackImages = function (client) {
if (!client.distribution) {
return;
}
var distribution = client.distribution.toLowerCase();
// only swap out images for China Repack builds (issue 10157)
if (distribution !== 'mozillaonline') {
return;
}
var images = document.querySelectorAll(
'img[data-' + distribution + '-link]'
);
for (var j = 0; j < images.length; j++) {
var distributionSrc = images[j].getAttribute(
'data-' + distribution + '-link'
);
images[j].setAttribute('src', distributionSrc);
}
};
// client-side redirects (handy for testing)
Utils.doRedirect = function (destination) {
if (destination) {

Просмотреть файл

@ -58,38 +58,6 @@ describe('mozilla-utils.js', function () {
});
});
describe('maybeSwitchToChinaRepackImages', function () {
const defaultSrc = '/img/placeholder.png';
const partnerASrc = '/img/foo.png';
beforeEach(function () {
const img = `<img class="test-image" src="${defaultSrc}" data-mozillaonline-link="${partnerASrc}">`;
document.body.insertAdjacentHTML('beforeend', img);
});
afterEach(function () {
document.querySelectorAll('.test-image').forEach((e) => {
e.parentNode.removeChild(e);
});
});
it('should use specified image for mozillaonline distributions', function () {
Mozilla.Utils.maybeSwitchToChinaRepackImages({
distribution: 'mozillaonline'
});
const img = document.querySelector('.test-image');
expect(img.src).toContain(partnerASrc);
});
it('should use default image for other distributions', function () {
Mozilla.Utils.maybeSwitchToChinaRepackImages({
distribution: 'regata os'
});
const img = document.querySelector('.test-image');
expect(img.src).toContain(defaultSrc);
});
});
describe('getDownloadAttributionValues', function () {
it('should return expected values for Windows', function () {
const site = {

Просмотреть файл

@ -436,7 +436,7 @@ describe('all-downloads-unified.js', function () {
<h4 class="c-locale-label">Multiple languages</h4>
<ul class="c-download-list">
<li>
<a id="playStoreLink-list" rel="external" href="https://play.google.com/store/apps/details?id=org.mozilla.firefox" data-link-type="download" data-download-os="Android" data-mozillaonline-link="https://play.google.com/store/apps/details?id=cn.mozilla.firefox&amp;referrer=utm_source%3Dmozilla%26utm_medium%3DReferral%26utm_campaign%3Dmozilla-org">
<a id="playStoreLink-list" rel="external" href="https://play.google.com/store/apps/details?id=org.mozilla.firefox" data-link-type="download" data-download-os="Android">
Google Play
</a>
</li>