diff --git a/apps/passwords/js/Static/compatibility.js b/apps/passwords/js/Static/compatibility.js
index c7970f56aed2597b19f7faf73a7e90702589618c..34f6f315788e37b169b01f16c5076bceab2461ed 100644
--- a/apps/passwords/js/Static/compatibility.js
+++ b/apps/passwords/js/Static/compatibility.js
@@ -1,52 +1,60 @@
-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 tl = function(t) {return OC.L10N.translate('passwords', t);},
+ imgpath = OC.filePath('passwords', 'img', 'browser/'),
+ container = document.getElementById('main'),
+ title = tl('CompatHeadline'),
+ message = tl('CompatText1') + '
' + tl('CompatText2');
+
+ 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 = tl('CompatWASMHeadline');
+ message = tl('CompatWASMText1') +
+ '
' + tl('CompatWASMText2') + '
' +
+ (handbookLink ? '':'') +
+ tl('CompatWASMHandbookLink') +
+ (handbookLink ? '':'') +
+ '
' + tl('CompatWASMText3');
+ }
- var imgpath = OC.filePath('passwords', 'img', 'browser/'),
- container = document.getElementById('main');
container.innerHTML =
- '