diff --git a/src/img/browser/brave.png b/src/img/browser/brave.png
new file mode 100755
index 000000000..50039e7eb
Binary files /dev/null and b/src/img/browser/brave.png differ
diff --git a/src/img/browser/tor.png b/src/img/browser/tor.png
old mode 100644
new mode 100755
index 07be37a35..b2e9e6fa7
Binary files a/src/img/browser/tor.png and b/src/img/browser/tor.png differ
diff --git a/src/js/Helper/compatibility.js b/src/js/Helper/compatibility.js
index 6549f2123..540affda3 100644
--- a/src/js/Helper/compatibility.js
+++ b/src/js/Helper/compatibility.js
@@ -1,48 +1,65 @@
-function isCompatibleBrowser() {
+function checkBrowserSupport() {
try {
if(!window.hasOwnProperty('crypto') || typeof window.crypto.subtle !== "object") {
- console.error('Web Crypto API not supported');
- return false;
+ return 'crypto';
}
if(!window.hasOwnProperty('TextEncoder')) {
- console.error('TextEncoder not supported');
- return false;
+ return 'TextEncoder';
}
if(!window.hasOwnProperty('WebAssembly') || typeof window.WebAssembly.instantiate !== "function") {
- console.error('WebAssembly not supported');
- return false;
+ return 'WebAssembly';
}
} catch(e) {
console.error(e);
- return false;
+ return 'ECMAScript 2017 / ES2017';
}
return true;
}
-function showBrowserCompatibilityWarning() {
+function showBrowserCompatibilityWarning(reason) {
var imgpath = OC.filePath('passwords', 'img', 'browser/'),
- container = document.getElementById('main');
+ container = document.getElementById('main'),
+ title = 'Your browser is outdated',
+ message = 'Your browser is outdated and does not have the necessary functionality to run this app.' +
+ '
Please check if an update is available for your browser or choose a modern and compatible browser from the list below.';
+
+ if(reason === 'WebAssembly') {
+ var handbookLink = null,
+ settings = OCP.InitialState.loadState('passwords', 'settings');
+
+ if(settings && settings['server.handbook.url']) {
+ handbookLink = settings['server.handbook.url.web'] + 'Enable-WebAssembly';
+ }
+
+ title = 'Your browser does not support WebAssembly';
+ message = 'Your browser does not support WebAssembly (WASM), which is required to run this app. ' +
+ '
In some browsers, WebAssembly must be enabled in the browser configuration.
' +
+ (handbookLink ? '':'') +
+ 'A guide to enable WebAssembly can be found in the Passwords App handbook.' +
+ (handbookLink ? '':'') +
+ '
If your browser does not have WebAssembly support, check if an update is available for your browser or choose a modern and compatible browser from the list below.';
+ }
+
container.innerHTML =
- '