diff --git a/app/scripts/app.js b/app/scripts/app.js index 6dcaea4e..f7c52d60 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -33,6 +33,7 @@ ready(() => { .then(loadConfigs) .then(initModules) .then(loadRemoteConfig) + .then(ensureCanRun) .then(showApp) .catch(e => { appModel.appLogger.error('Error starting app', e); @@ -43,6 +44,20 @@ ready(() => { require('./helpers'); } + function ensureCanRun() { + return Promise.resolve() + .then(() => FeatureDetector.ensureCanRun()) + .catch(e => { + Alerts.error({ + header: Locale.appSettingsError, + body: Locale.appNotSupportedError, + buttons: [], + esc: false, enter: false, click: false + }); + throw e; + }); + } + function loadConfigs() { return Promise.all([ AppSettingsModel.instance.load(), diff --git a/app/scripts/locales/base.json b/app/scripts/locales/base.json index 40c27d13..e87eef89 100644 --- a/app/scripts/locales/base.json +++ b/app/scripts/locales/base.json @@ -287,6 +287,7 @@ "appSaveErrorBodyMul": "Failed to auto-save files:", "appSettingsError": "Error loading app", "appSettingsErrorBody": "There was an error loading app settings. Please double check app url or contact your administrator.", + "appNotSupportedError": "Your browser is not supported.", "appTabWarn": "Too many tabs", "appTabWarnBody": "KeeWeb cannot be used in two browser tabs simultaneously, please close this tab.", diff --git a/app/scripts/util/feature-detector.js b/app/scripts/util/feature-detector.js index 2eb74540..bbaf385d 100644 --- a/app/scripts/util/feature-detector.js +++ b/app/scripts/util/feature-detector.js @@ -34,6 +34,18 @@ const FeatureDetector = { }, hasUnicodeFlags: function() { return this.isMac; + }, + ensureCanRun: function() { + if (/MSIE |Trident/.test(navigator.userAgent)) { + throw 'IE detected'; + } + if (!localStorage.length) { + try { + localStorage.appSettings = ''; + } catch (e) { + throw 'localStorage not available'; + } + } } }; diff --git a/release-notes.md b/release-notes.md index 9163f629..eebfdde4 100644 --- a/release-notes.md +++ b/release-notes.md @@ -4,6 +4,7 @@ Release notes `+` plugins `*` translations are available only as plugins `*` Dropbox API V2 +`*` deprecated IE `+` entry templates `+` support cloud providers in iOS homescreen apps `+` auto-type improvements and bugfixes @@ -17,6 +18,7 @@ Release notes `+` mac os window style options `+` lock on hide mac os hide `+` release distribution improvements +`+` error message for not supported browsers `-` removed support of devices without clipboard api ##### v1.4.1 (2017-03-26)