From d140479ecc7b47bd24f0c9593766188302f2d7f0 Mon Sep 17 00:00:00 2001 From: Ray Lothian Date: Sat, 8 Aug 2020 06:49:30 +0200 Subject: [PATCH] fixes http://add0n.com/useragent-switcher.html#IDComment1092309378 --- extension/data/popup/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extension/data/popup/index.js b/extension/data/popup/index.js index 750f3d5..8526da9 100644 --- a/extension/data/popup/index.js +++ b/extension/data/popup/index.js @@ -202,7 +202,8 @@ document.addEventListener('DOMContentLoaded', () => fetch('./map.json').then(r = document.getElementById('sort').value = prefs['popup-sort']; chrome.runtime.getBackgroundPage(bg => { - const ua = bg.prefs.ua || navigator.userAgent; + // Firefox in private mode -> there is no bg! + const ua = (bg ? bg.prefs.ua : '') || navigator.userAgent; update(ua); document.getElementById('ua').value = ua; document.getElementById('ua').dispatchEvent(new Event('input'));