enable promo banner
This commit is contained in:
parent
44043b54b3
commit
d28da3247d
|
@ -93,6 +93,10 @@ export default async function getCapabilities() {
|
||||||
const share =
|
const share =
|
||||||
typeof navigator.share === 'function' && LOCALE.startsWith('en'); // en until strings merge
|
typeof navigator.share === 'function' && LOCALE.startsWith('en'); // en until strings merge
|
||||||
|
|
||||||
|
const standalone =
|
||||||
|
window.matchMedia('(display-mode: standalone)').matches ||
|
||||||
|
navigator.standalone;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
account,
|
account,
|
||||||
crypto,
|
crypto,
|
||||||
|
@ -101,6 +105,7 @@ export default async function getCapabilities() {
|
||||||
streamDownload:
|
streamDownload:
|
||||||
nativeStreams && serviceWorker && browserName() !== 'safari',
|
nativeStreams && serviceWorker && browserName() !== 'safari',
|
||||||
multifile: nativeStreams || polyStreams,
|
multifile: nativeStreams || polyStreams,
|
||||||
share
|
share,
|
||||||
|
standalone
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,15 @@ const Header = require('./header');
|
||||||
const Footer = require('./footer');
|
const Footer = require('./footer');
|
||||||
|
|
||||||
function banner(state) {
|
function banner(state) {
|
||||||
if (state.promo && !state.route.startsWith('/unsupported/')) {
|
if (state.layout) {
|
||||||
|
return; // server side
|
||||||
|
}
|
||||||
|
const show =
|
||||||
|
!state.capabilities.standalone &&
|
||||||
|
!/firefox/i.test(navigator.userAgent) &&
|
||||||
|
document.querySelector('html').lang.startsWith('en') &&
|
||||||
|
!state.route.startsWith('/unsupported/');
|
||||||
|
if (show) {
|
||||||
return state.cache(Promo, 'promo').render();
|
return state.cache(Promo, 'promo').render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,8 @@ class Promo extends Component {
|
||||||
<a
|
<a
|
||||||
class="text-blue"
|
class="text-blue"
|
||||||
href="https://www.mozilla.org/firefox/new/?utm_campaign=send-acquisition&utm_medium=referral&utm_source=send.firefox.com"
|
href="https://www.mozilla.org/firefox/new/?utm_campaign=send-acquisition&utm_medium=referral&utm_source=send.firefox.com"
|
||||||
>Download Firefox now ≫</a
|
>
|
||||||
|
Download Firefox now ≫</a
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue