From c0660f59fb903561087730959bd04ac5e4ad6a04 Mon Sep 17 00:00:00 2001 From: Yousuf Nejati Date: Wed, 9 Aug 2017 09:09:10 -0700 Subject: [PATCH] NOJIRA: Enhance browser compatibility check. --- src/main/webapp/defaults/html/index.html | 5 +++++ src/main/webapp/defaults/js/Login.js | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/defaults/html/index.html b/src/main/webapp/defaults/html/index.html index fb81bd072..184878b01 100644 --- a/src/main/webapp/defaults/html/index.html +++ b/src/main/webapp/defaults/html/index.html @@ -206,6 +206,11 @@ + diff --git a/src/main/webapp/defaults/js/Login.js b/src/main/webapp/defaults/js/Login.js index 5d58d6967..9f8534738 100644 --- a/src/main/webapp/defaults/js/Login.js +++ b/src/main/webapp/defaults/js/Login.js @@ -16,11 +16,21 @@ cspace = cspace || {}; (function ($, fluid) { fluid.log("Login.js loaded"); - // Notify user of IE browser incompatibility if IE is being used. - var browser = navigator.userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; - if(/trident/i.test(M[1])){ - window.alert('Notice: CollectionSpace is not optimized to use Internet Explorer. For an optimal experience please use the latest versions of Chrome or Firefox.'); - } + + // Alert users if they happen to be using an incompatible browser aka. Microsoft. + var browserCompatibilityCheck = function () { + + // User strings may change with time, + // please see: https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx + // to stay up to date. + if (/MSIE 10/i.test(navigator.userAgent) || + /MSIE 9/i.test(navigator.userAgent) || + /rv:11.0/i.test(navigator.userAgent) || + /Edge\/\d./i.test(navigator.userAgent)) + { + window.alert('Hey there CollectionSpace user! Unfortunately, CollectionSpace is not optimized for use with your current browser. For an optimal experience, please use the latest version of Chrome or Firefox. - The CollectionSpace Team'); + } + }; // Show sign in UI and make sure everything else is hidden. var showSignIn = function (domBinder) {