removed old feature detecting stuff

This commit is contained in:
antelle 2018-08-30 22:21:57 +02:00
parent 1054cdcfc4
commit 9924dff39a
4 changed files with 9 additions and 28 deletions

View File

@ -51,16 +51,15 @@ ready(() => {
}
function ensureCanRun() {
return Promise.resolve()
.then(() => FeatureDetector.ensureCanRun())
return FeatureTester.test()
.catch(e => {
Alerts.error({
header: Locale.appSettingsError,
body: Locale.appNotSupportedError,
body: Locale.appNotSupportedError + '<br/><br/>' + e,
buttons: [],
esc: false, enter: false, click: false
});
throw e;
throw 'Feature testing failed: ' + e;
});
}
@ -109,15 +108,7 @@ ready(() => {
}
function showApp() {
return FeatureTester.test()
.catch(e => {
Alerts.error({
header: Locale.appFeatureTestFailed, esc: false, enter: false, click: false,
body: Locale.appFeatureTestFailedBody + '<br/><br/>' + e,
buttons: []
});
throw 'Feature testing failed: ' + e;
})
return Promise.resolve()
.then(() => {
const skipHttpsWarning = localStorage.skipHttpsWarning || appModel.settings.get('skipHttpsWarning');
const protocolIsInsecure = ['https:', 'file:', 'app:'].indexOf(location.protocol) < 0;

View File

@ -1,4 +1,5 @@
const kdbxweb = require('kdbxweb');
const FeatureDetector = require('../util/feature-detector');
const FeatureTester = {
test() {
@ -38,6 +39,9 @@ const FeatureTester = {
},
checkLocalStorage() {
if (FeatureDetector.isDesktop) {
return;
}
try {
localStorage.setItem('_test', '1');
localStorage.removeItem('_test');

View File

@ -285,8 +285,6 @@
"appSecWarnBody1": "You have loaded this app with an insecure connection. Someone may be watching you and stealing your passwords. We strongly advise you to stop, unless you clearly understand what you're doing.",
"appSecWarnBody2": "Yes, your database is encrypted but no one can guarantee that the app has not been modified on the way to you.",
"appSecWarnBtn": "I understand the risks, continue",
"appFeatureTestFailed": "Not supported",
"appFeatureTestFailedBody": "Your browser doesn't support some important features we're using.",
"appUnsavedWarn": "Unsaved changes!",
"appUnsavedWarnBody": "You have unsaved files, if you close the app, changes will be lost.",
"appDontExitBtn": "Don't exit",
@ -298,7 +296,7 @@
"appSaveErrorBodyMul": "Failed to auto-save files:",
"appSettingsError": "Error loading app",
"appSettingsErrorBody": "There was an error loading app settings. Please double check the app URL or contact your administrator.",
"appNotSupportedError": "Your browser is not supported.",
"appNotSupportedError": "Your browser doesn't support some important features we're using.",
"appTabWarn": "Too many tabs",
"appTabWarnBody": "KeeWeb cannot be used in two browser tabs simultaneously, please close this tab.",
"appRightsAlert": "Locking KeeWeb app",

View File

@ -40,18 +40,6 @@ const FeatureDetector = {
hasUnicodeFlags: function() {
return this.isMac;
},
ensureCanRun: function() {
if (!window.crypto) {
throw 'WebCrypto not available';
}
if (!localStorage.length && !isDesktop) {
try {
localStorage.appSettings = '';
} catch (e) {
throw 'localStorage not available';
}
}
},
getBrowserCssClass: function() {
if (window.chrome && window.chrome.webstore) {
return 'chrome';