From d6bd922940f1e759b2a8407c93ff9a92f31ece2d Mon Sep 17 00:00:00 2001 From: Katarzyna Dunikowska Date: Fri, 7 Apr 2017 12:51:52 +0200 Subject: [PATCH] Fix errors on safari and opera #594 --- src/containers/Login.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/containers/Login.js b/src/containers/Login.js index 84e0b7d4d..62a61bbbd 100644 --- a/src/containers/Login.js +++ b/src/containers/Login.js @@ -16,19 +16,18 @@ class Login extends Component { } userBrowser = () => { - let opr; - let safari; const isChrome = !!window.chrome && !!window.chrome.webstore; const isFirefox = typeof InstallTrigger !== 'undefined'; - const isSafari = /constructor/i.test(window.HTMLElement) || - (function (p) { return p.toString() === - '[object SafariRemoteNotification]'; })(!window['safari'] || - safari.pushNotification); - const isOpera = (!!window.opr && !!opr.addons) || !!window.opera || - navigator.userAgent.indexOf(' OPR/') >= 0; + const isSafari = navigator.vendor && + navigator.vendor.indexOf('Apple') > -1 && + navigator.userAgent && + !navigator.userAgent.match('CriOS'); + + const isOpera = (!!window.opr && !!window.opr.addons) || + !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; const isIE = /*@cc_on!@*/false || !!document.documentMode; // IE 6-11