From b34de2d5cff6527c7b839fab3f7c1b4bd6b981c3 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 13 Dec 2021 17:25:39 +0100 Subject: [PATCH] dont run sidebar ad on android firefox --- web/component/ads/view.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/component/ads/view.jsx b/web/component/ads/view.jsx index 0cd11e451..280461f75 100644 --- a/web/component/ads/view.jsx +++ b/web/component/ads/view.jsx @@ -23,6 +23,12 @@ const IS_IOS = (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && !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 = { location: { pathname: string }, type: string, @@ -136,7 +142,12 @@ function Ads(props: Props) { if (!SHOW_ADS || triggerBlacklist) { return false; } + // sidebar ad if (type === 'video') { + // don't run sidebar ad on Android Firefox because it errors out + if (isFirefoxAndroid) { + return false; + } return videoAd; } if (type === 'homepage') {