dont run sidebar ad on android firefox

This commit is contained in:
Anthony 2021-12-13 17:25:39 +01:00 committed by Thomas Zarebczan
parent 3b87f0aba6
commit b34de2d5cf

View file

@ -23,6 +23,12 @@ const IS_IOS =
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
!window.MSStream; !window.MSStream;
const IS_ANDROID = /Android/i.test(navigator.userAgent);
const IS_FIREFOX = /Firefox/i.test(navigator.userAgent);
const isFirefoxAndroid = IS_ANDROID && IS_FIREFOX;
type Props = { type Props = {
location: { pathname: string }, location: { pathname: string },
type: string, type: string,
@ -136,7 +142,12 @@ function Ads(props: Props) {
if (!SHOW_ADS || triggerBlacklist) { if (!SHOW_ADS || triggerBlacklist) {
return false; return false;
} }
// sidebar ad
if (type === 'video') { if (type === 'video') {
// don't run sidebar ad on Android Firefox because it errors out
if (isFirefoxAndroid) {
return false;
}
return videoAd; return videoAd;
} }
if (type === 'homepage') { if (type === 'homepage') {