Browse Source

Merge pull request #971 from threema-ch/970-edge

Support Edge 79+
Danilo Bargen 5 năm trước cách đây
mục cha
commit
3e498766b9

+ 2 - 1
public/i18n/cs.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Znovu připojit",
         "BROWSER_NOT_SUPPORTED": "Tento prohlížeč není podporován",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Tento prohlížeč nelze na Androidu použít",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Použijte prosím nejnovější verzi prohlížeče <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> nebo <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (pouze pro iOS), jiné prohlížeče nemusí být kompatibilní.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Použijte prosím nejnovější verzi prohlížeče {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} nebo {safariLink} (pouze pro iOS), jiné prohlížeče nemusí být kompatibilní.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Použijte prosím nejnovější verzi prohlížeče {firefoxLink}, {chromeLink}, {operaLink} nebo {edgeLink}, jiné prohlížeče nemusí být kompatibilní.",
         "SAFARI": "Safari je kompatibilní pouze s Threema Web pro iOS. <br>Pokud používáte systém Android, použijte prosím jiný prohlížeč.",
         "CONNECTING": "Navazuji spojení",
         "WAITING_FOR_PUSH": "Čeká se na<br> start aplikace ...",

+ 2 - 1
public/i18n/de.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Verbindung aufbauen",
         "BROWSER_NOT_SUPPORTED": "Dieser Browser wird nicht unterst\u00fctzt",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Dieser Browser wird von Android-Geräten nicht unterst\u00fctzt",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Bitte verwenden Sie die aktuelle Version von <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> oder <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (nur unter iOS), um Threema Web ohne Einschränkungen zu nutzen.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Bitte verwenden Sie die aktuelle Version von {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} oder {safariLink} (nur unter iOS), um Threema Web ohne Einschränkungen zu nutzen.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Bitte verwenden Sie die aktuelle Version von {firefoxLink}, {chromeLink}, {operaLink} oder {edgeLink}, um Threema Web ohne Einschränkungen zu nutzen.",
         "SAFARI": "Safari ist nur kompatibel mit Threema Web für iOS. Android-Nutzer verwenden bitte einen anderen Browser.",
         "CONNECTING": "Verbindung wird aufgebaut",
         "WAITING_FOR_PUSH": "Threema-App wird<br>aufgeweckt …",

+ 2 - 1
public/i18n/en.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Reconnect",
         "BROWSER_NOT_SUPPORTED": "This browser is not supported",
         "BROWSER_NOT_SUPPORTED_ANDROID": "This browser is not supported on Android",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Please use the latest version of <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> or <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (iOS only), otherwise the web client might not work properly.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Please use the latest version of {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} or {safariLink} (iOS only), otherwise Threema Web might not work properly.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Please use the latest version of {firefoxLink}, {chromeLink}, {operaLink} or {edgeLink}, otherwise Threema Web might not work properly.",
         "SAFARI": "Safari is only compatible with Threema Web for iOS.<br>If you are using Android, please use another browser.",
         "CONNECTING": "Connecting",
         "WAITING_FOR_PUSH": "Waiting for<br>app wakeup …",

+ 2 - 1
public/i18n/es.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Reconectar",
         "BROWSER_NOT_SUPPORTED": "Este navegador no es compatible",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Este navegador no es compatible con los dispositivos Android",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Por favor, utiliza la última versión de <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> o <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (sólo IOS), de lo contrario el cliente Web podría no funcionar correctamente.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Por favor, utiliza la última versión de {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} o {safariLink} (sólo IOS), de lo contrario Threema Web podría no funcionar correctamente.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Por favor, utiliza la última versión de {firefoxLink}, {chromeLink}, {operaLink} o {edgeLink}, de lo contrario Threema Web podría no funcionar correctamente.",
         "SAFARI": "Safari solo es compatible con Threema Web para iOS.<br>Si estás usando Android, por favor utiliza otro navegador.",
         "CONNECTING": "Conectando",
         "WAITING_FOR_PUSH": "Waiting for<br>app wakeup …",

+ 2 - 1
public/i18n/fr.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Reconnecter",
         "BROWSER_NOT_SUPPORTED": "Ce navigateur n'est pas compatible.",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Ce navigateur n'est pas compatible sous Android.",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Veuillez utiliser la dernière version de <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> ou <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (iOS uniqument), sinon le client web pourrait ne pas fonctionner correctement.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Veuillez utiliser la dernière version de {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} ou {safariLink} (iOS uniqument), sinon le client web pourrait ne pas fonctionner correctement.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Veuillez utiliser la dernière version de {firefoxLink}, {chromeLink}, {operaLink} ou {edgeLink}, sinon le client web pourrait ne pas fonctionner correctement.",
         "SAFARI": "Safari est seulement compatible avec Threema Web pour iOS.<br>Si vous utilisez Android, veuillez utiliser un autre navigateur.",
         "CONNECTING": "Connexion en cours",
         "WAITING_FOR_PUSH": "En attente de<br>l'activation de l'application…",

+ 2 - 1
public/i18n/nl.json

@@ -23,7 +23,8 @@
         "BTN_RECONNECT": "Herverbinden",
         "BROWSER_NOT_SUPPORTED": "Deze browser wordt niet ondersteund",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Deze browser wordt niet op Android ondersteund",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Gebruik de laatste versie van<a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> or <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (alleen iOS), anders werkt de web client mogelijk niet goed.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Gebruik de laatste versie van {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} of {safariLink} (alleen iOS), anders werkt Threema Web mogelijk niet goed.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Gebruik de laatste versie van {firefoxLink}, {chromeLink}, {operaLink} of {edgeLink}, anders werkt Threema Web mogelijk niet goed.",
         "SAFARI": "Safari is alleen compatible met Threema Web voor iOS.<br>Indien je Android gebruikt, gebruik dan een andere browser.",
         "CONNECTING": "Verbinden",
         "WAITING_FOR_PUSH": "Wachten tot<br>app reageert …",

+ 2 - 1
public/i18n/pl.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Połącz ponownie",
         "BROWSER_NOT_SUPPORTED": "Ta przeglądarka jest niewspierana ",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Ta przeglądarka jest niewspierana na systemie Android.",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Używaj najnowszej wersji <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opery</a> lub <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (tylko iOS), w przeciwnym wypadku klient web może nie działać poprawnie.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Używaj najnowszej wersji {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} lub {safariLink} (tylko iOS), w przeciwnym wypadku klient web może nie działać poprawnie.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Używaj najnowszej wersji {firefoxLink}, {chromeLink}, {operaLink} lub {edgeLink}, w przeciwnym wypadku klient web może nie działać poprawnie.",
         "SAFARI": "Safari jest kompatybilny tylko z Threemą Web dla iOS.<br>Jeżeli korzystasz z systemu Android, użyj innej przeglądarki.",
         "CONNECTING": "Łączenie",
         "WAITING_FOR_PUSH": "Oczekiwanie na<br>wybudzenie aplikacji.",

+ 0 - 1
public/i18n/pt.json

@@ -23,7 +23,6 @@
         "BTN_RECONNECT": "Reconectar",
         "BROWSER_NOT_SUPPORTED": "Esta página não é suportada",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Esquecer esta sessão em Android",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Please use the latest version of <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> or <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (iOS only), otherwise the web client might not work properly.",
         "SAFARI": "Safari is only compatible with Threema Web for iOS.<br>If you are using Android, please use another browser.",
         "CONNECTING": "A ligar",
         "WAITING_FOR_PUSH": "À espera do inicio de <br> ...",

+ 2 - 1
public/i18n/sk.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Znova pripojiť",
         "BROWSER_NOT_SUPPORTED": "Tento prehliadač nie je podporovaný",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Tento prehliadač nie je na Androide podporovaný",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Použite prosím najnovšiu verziu prehliadača<a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> alebo <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a> (iOS only), v opačnom prípade klient nemusí pracovať správne.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Použite prosím najnovšiu verziu prehliadača {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} alebo {safariLink} (iOS only), v opačnom prípade klient nemusí pracovať správne.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Použite prosím najnovšiu verziu prehliadača {firefoxLink}, {chromeLink}, {operaLink} alebo {edgeLink}, v opačnom prípade klient nemusí pracovať správne.",
         "SAFARI": "Safari je kompatibilné len s Threema Web pre iOS.<br> Pokiaľ používate systém Android, použite prosím iný prehliadač.",
         "CONNECTING": "Pripájanie",
         "WAITING_FOR_PUSH": "Čaká sa na <br> štart aplikácie ...",

+ 2 - 1
public/i18n/uk.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "Повторне підключення",
         "BROWSER_NOT_SUPPORTED": "Цей браузер не підтримується",
         "BROWSER_NOT_SUPPORTED_ANDROID": "Цей браузер не підтримується на Android",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "Будь ласка, використовуй останню версію <a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>Google Chrome</a>, <a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>Mozilla Firefox</a>, <a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>Opera</a> або <a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari</a>(тільки для ІОС), або ця версія може погано працювати в цьому браузері.",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "Будь ласка, використовуй останню версію {firefoxLink}, {chromeLink}, {operaLink}, {edgeLink} або {safariLink} (тільки для ІОС), або ця версія може погано працювати в цьому браузері.",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "Будь ласка, використовуй останню версію {firefoxLink}, {chromeLink}, {operaLink} або {edgeLink}, або ця версія може погано працювати в цьому браузері.",
         "SAFARI": "Safari доступне тільки для ІОС. <br>Якщо ти використовуєш Android, прошу користуйся іншим браузером.",
         "CONNECTING": "З'єднання",
         "WAITING_FOR_PUSH": "Очікую підключення додатку <br> …",

+ 2 - 1
public/i18n/zh.json

@@ -24,7 +24,8 @@
         "BTN_RECONNECT": "重连",
         "BROWSER_NOT_SUPPORTED": "不支持您的浏览器",
         "BROWSER_NOT_SUPPORTED_ANDROID": "安卓系统不支持这个浏览器",
-        "BROWSER_NOT_SUPPORTED_DETAILS": "请使用最新版的<a href='https://www.google.com/chrome/browser/desktop/' target='_blank' rel='noopener noreferrer'>谷歌Chrome浏览器</a>,<a href='https://www.mozilla.org/' target='_blank' rel='noopener noreferrer'>火狐Mozilla浏览器</a>,<a href='https://www.opera.com/' target='_blank' rel='noopener noreferrer'>欧朋Opera浏览器</a>或者<a href='https://www.apple.com/safari/' target='_blank' rel='noopener noreferrer'>Safari浏览器(仅限iOS)</a>, 使用其他浏览器可能导致无法正常使用。",
+        "BROWSER_NOT_SUPPORTED_DETAILS": "请使用最新版的{firefoxLink},{chromeLink},{operaLink},{edgeLink}或者{safariLink}(仅限iOS), 使用其他浏览器可能导致无法正常使用。",
+        "BROWSER_NOT_SUPPORTED_ANDROID_DETAILS": "请使用最新版的{firefoxLink},{chromeLink},{operaLink}或者{edgeLink},使用其他浏览器可能导致无法正常使用。",
         "SAFARI": "Safari仅与适用于iOS的Threema Web兼容。如果您使用的是Android,请使用其他浏览器。",
         "CONNECTING": "连接中",
         "WAITING_FOR_PUSH": "等待唤醒APP",

+ 1 - 0
src/app.ts

@@ -77,6 +77,7 @@ angular.module('3ema', [
     CHROME: 65,
     OPERA: 52,
     SAFARI: 11,
+    EDGE: 79,
 })
 
 // Set default route

+ 16 - 3
src/partials/welcome.ts

@@ -123,7 +123,7 @@ class WelcomeController {
         // Determine whether browser warning should be shown
         this.browser = browserService.getBrowser();
         const version = this.browser.version;
-        this.log.debug('Detected browser:', this.browser.description());
+        this.log.info('Detected browser:', this.browser.description());
         if (!this.browser.wasDetermined()) {
             this.log.warn('Could not determine browser version');
             this.showBrowserWarning();
@@ -147,8 +147,13 @@ class WelcomeController {
                 this.log.warn('Safari is too old (' + version + ' < ' + minVersions.SAFARI + ')');
                 this.showBrowserWarning();
             }
+        } else if (this.browser.name === threema.BrowserName.Edge) {
+            if (version < minVersions.EDGE) {
+                this.log.warn('Edge is too old (' + version + ' < ' + minVersions.EDGE + ')');
+                this.showBrowserWarning();
+            }
         } else {
-            this.log.warn('Non-supported browser, please use Chrome, Firefox or Opera');
+            this.log.warn('Non-supported browser, please use Chrome, Firefox, Edge or Opera');
             this.showBrowserWarning();
         }
 
@@ -441,11 +446,19 @@ class WelcomeController {
     private showBrowserWarning(): void {
         this.browserWarningShown = true;
         this.$translate.onReady().then(() => {
+            // tslint:disable:max-line-length
             const confirm = this.$mdDialog.confirm()
                 .title(this.$translate.instant('welcome.BROWSER_NOT_SUPPORTED'))
-                .htmlContent(this.$translate.instant('welcome.BROWSER_NOT_SUPPORTED_DETAILS'))
+                .htmlContent(this.$translate.instant('welcome.BROWSER_NOT_SUPPORTED_DETAILS', {
+                    firefoxLink: '<a href="https://www.mozilla.org/firefox/" target="_blank" rel="noopener noreferrer">Firefox</a>',
+                    chromeLink: '<a href="https://www.google.com/chrome/browser/desktop/" target="_blank" rel="noopener noreferrer">Chrome</a>',
+                    operaLink: '<a href="https://www.opera.com/" target="_blank" rel="noopener noreferrer">Opera</a>',
+                    edgeLink: '<a href="https://www.microsoft.com/edge" target="_blank" rel="noopener noreferrer">Edge</a>',
+                    safariLink: '<a href="https://www.apple.com/safari/" target="_blank" rel="noopener noreferrer">Safari</a>',
+                }))
                 .ok(this.$translate.instant('welcome.CONTINUE_ANYWAY'))
                 .cancel(this.$translate.instant('welcome.ABORT'));
+            // tslint:enable:max-line-length
             this.$mdDialog.show(confirm).then(() => {
                 // do nothing
             }, () => {

+ 3 - 3
src/services/browser.ts

@@ -49,12 +49,12 @@ export class BrowserService {
 
             const uagent = this.$window.navigator.userAgent.toLowerCase();
 
-            browser.chrome = /webkit/.test(uagent) && /chrome/.test(uagent) && !/edge/.test(uagent);
+            browser.chrome = /webkit/.test(uagent) && /chrome/.test(uagent) && !/edg/.test(uagent);
             browser.chromeIos = /mozilla/.test(uagent) && /crios/.test(uagent);
             browser.firefox = /mozilla/.test(uagent) && /firefox/.test(uagent);
             browser.firefoxIos = /mozilla/.test(uagent) && /fxios/.test(uagent);
             browser.ie = (/msie/.test(uagent) || /trident/.test(uagent)) && !/edge/.test(uagent);
-            browser.edge = /edge/.test(uagent);
+            browser.edge = /edg/.test(uagent);
             browser.safari = /safari/.test(uagent) && /applewebkit/.test(uagent)
                           && !/chrome/.test(uagent) && !/fxios/.test(uagent) && !/crios/.test(uagent);
             browser.opera = /mozilla/.test(uagent) && /applewebkit/.test(uagent)
@@ -71,7 +71,7 @@ export class BrowserService {
                     if (x === 'ie') {
                         b = 'msie';
                     } else if (x === 'edge') {
-                        b = 'edge';
+                        b = 'edge?';
                     } else if (x === 'opera') {
                         b = 'opr';
                     } else if (x === 'firefoxIos') {

+ 8 - 1
src/services/webclient.ts

@@ -619,10 +619,17 @@ export class WebClientService {
      */
     private showWebrtcAndroidWarning(): void {
         this.$translate.onReady().then(() => {
+            // tslint:disable:max-line-length
             const confirm = this.$mdDialog.alert()
                 .title(this.$translate.instant('welcome.BROWSER_NOT_SUPPORTED_ANDROID'))
-                .htmlContent(this.$translate.instant('welcome.BROWSER_NOT_SUPPORTED_DETAILS'))
+                .htmlContent(this.$translate.instant('welcome.BROWSER_NOT_SUPPORTED_ANDROID_DETAILS', {
+                    firefoxLink: '<a href="https://www.mozilla.org/firefox/" target="_blank" rel="noopener noreferrer">Firefox</a>',
+                    chromeLink: '<a href="https://www.google.com/chrome/browser/desktop/" target="_blank" rel="noopener noreferrer">Chrome</a>',
+                    operaLink: '<a href="https://www.opera.com/" target="_blank" rel="noopener noreferrer">Opera</a>',
+                    edgeLink: '<a href="https://www.microsoft.com/edge" target="_blank" rel="noopener noreferrer">Edge</a>',
+                }))
                 .ok(this.$translate.instant('welcome.ABORT'));
+            // tslint:enable:max-line-length
             this.$mdDialog.show(confirm).then(() => {
                 // Redirect to Threema website
                 window.location.replace('https://threema.ch/threema-web');

+ 1 - 0
src/threema.d.ts

@@ -699,6 +699,7 @@ declare namespace threema {
         CHROME: number;
         OPERA: number;
         SAFARI: number;
+        EDGE: number;
     }
 
     interface BatteryStatus {

+ 30 - 0
tests/service/browser.js

@@ -95,6 +95,36 @@ describe('BrowserService', function() {
         expect(browser.description()).toEqual('Edge 12');
     });
 
+    it('edge14', () => {
+        const ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14931';
+        const service = testUserAgent(ua);
+        const browser = service.getBrowser();
+        expect(browser.name).toBe(BrowserName.Edge);
+        expect(browser.version).toEqual(14);
+        expect(browser.mobile).toBe(false);
+        expect(browser.description()).toEqual('Edge 14');
+    });
+
+    it('edge18', () => {
+        const ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763';
+        const service = testUserAgent(ua);
+        const browser = service.getBrowser();
+        expect(browser.name).toBe(BrowserName.Edge);
+        expect(browser.version).toEqual(18);
+        expect(browser.mobile).toBe(false);
+        expect(browser.description()).toEqual('Edge 18');
+    });
+
+    it('edge80', () => {
+        const ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36 Edg/80.0.361.62';
+        const service = testUserAgent(ua);
+        const browser = service.getBrowser();
+        expect(browser.name).toBe(BrowserName.Edge);
+        expect(browser.version).toEqual(80);
+        expect(browser.mobile).toBe(false);
+        expect(browser.description()).toEqual('Edge 80');
+    });
+
     it('opera', () => {
         const ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36 OPR/51.0.2830.55';
         const service = testUserAgent(ua);

+ 1 - 0
webpack.common.js

@@ -11,6 +11,7 @@ const babelOptions = {
         chrome: 65,
         opera: 52,
         safari: 11,
+        edge: 79,
       },
     }],
   ],