diff options
Diffstat (limited to 'ext/js/background/environment.js')
-rw-r--r-- | ext/js/background/environment.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/js/background/environment.js b/ext/js/background/environment.js index 04099ca1..8111741f 100644 --- a/ext/js/background/environment.js +++ b/ext/js/background/environment.js @@ -83,9 +83,23 @@ class Environment { } catch (e) { // NOP } + if (this._isSafari()) { + return 'safari'; + } return 'firefox'; } else { return 'chrome'; } } + + _isSafari() { + const {vendor, userAgent} = navigator; + return ( + typeof vendor === 'string' && + typeof userAgent === 'string' && + vendor.includes('Apple') && + !userAgent.includes('CriOS') && + !userAgent.includes('FxiOS') + ); + } } |