diff options
author | Darius Jahandarie <djahandarie@gmail.com> | 2023-11-02 13:05:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 13:05:33 +0000 |
commit | 092d1beac6c1af8eae8615d541434513e875b4a5 (patch) | |
tree | 528d984e6f4b3f39e4502a6cf125f8fc30b86c6c /ext/js/extension/environment.js | |
parent | 55897b2b29e88ffd0c9140d03b9e74c4a94d98bd (diff) | |
parent | bbefd8a07ba71d7fe5e9c707ddb06e99bfd2a502 (diff) |
Merge pull request #293 from praschke/permissions-fixups
Permissions fixups
Diffstat (limited to 'ext/js/extension/environment.js')
-rw-r--r-- | ext/js/extension/environment.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/js/extension/environment.js b/ext/js/extension/environment.js index ec1e8612..ad5a19ae 100644 --- a/ext/js/extension/environment.js +++ b/ext/js/extension/environment.js @@ -31,8 +31,9 @@ class Environment { } async _loadEnvironmentInfo() { - const browser = await this._getBrowser(); const os = await this._getOperatingSystem(); + const browser = await this._getBrowser(os); + return { browser, platform: {os} @@ -64,7 +65,7 @@ class Environment { }); } - async _getBrowser() { + async _getBrowser(os) { try { if (chrome.runtime.getURL('/').startsWith('ms-browser-extension://')) { return 'edge-legacy'; @@ -76,17 +77,12 @@ class Environment { // NOP } if (typeof browser !== 'undefined') { - try { - const info = await browser.runtime.getBrowserInfo(); - if (info.name === 'Fennec') { - return 'firefox-mobile'; - } - } catch (e) { - // NOP - } if (this._isSafari()) { return 'safari'; } + if (os === 'android') { + return 'firefox-mobile'; + } return 'firefox'; } else { return 'chrome'; |