From 4c36b516edd685aa5d0c6f7306dcbd4d8b1434b7 Mon Sep 17 00:00:00 2001 From: R-J Lim Date: Wed, 19 Jun 2024 12:42:07 -0700 Subject: [PATCH] Speculative fix for track selector not appearing on mobile --- extension/src/background.ts | 9 ++++++--- extension/src/services/device-detection.ts | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/extension/src/background.ts b/extension/src/background.ts index 23346b95..1238adff 100755 --- a/extension/src/background.ts +++ b/extension/src/background.ts @@ -411,9 +411,12 @@ if (isFirefoxBuild) { } }); } else { - chrome.action.setPopup({ - popup: 'popup-ui.html', - }); + if (!isMobile) { + chrome.action.setPopup({ + popup: 'popup-ui.html', + }); + } + chrome.action.onClicked.addListener(defaultAction); } diff --git a/extension/src/services/device-detection.ts b/extension/src/services/device-detection.ts index 3f058222..854c86d5 100644 --- a/extension/src/services/device-detection.ts +++ b/extension/src/services/device-detection.ts @@ -1 +1,2 @@ -export const isMobile = (navigator as any).userAgentData?.mobile ?? navigator.userAgent.includes('Android') ?? false; +export const isMobile = + navigator.userAgent.toLowerCase().includes('android') ?? (navigator as any).userAgentData?.mobile ?? false;