Check SharedArrayBuffer support in outer

pull/1/head
yflory 3 years ago
parent 8846b2d10e
commit ab62b5f202

@ -616,6 +616,10 @@
getColor().toString(16); getColor().toString(16);
}; };
Util.supportsWasm = function () {
return !(typeof(Atomics) === "undefined" || typeof (SharedArrayBuffer) === "undefined" || typeof(WebAssembly) === 'undefined');
};
if (typeof(module) !== 'undefined' && module.exports) { if (typeof(module) !== 'undefined' && module.exports) {
module.exports = Util; module.exports = Util;
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {

@ -138,6 +138,10 @@ define([
var startOO = function () {}; var startOO = function () {};
var supportsXLSX = function () {
return privateData.supportsWasm;
};
var getMediasSources = APP.getMediasSources = function() { var getMediasSources = APP.getMediasSources = function() {
content.mediasSources = content.mediasSources || {}; content.mediasSources = content.mediasSources || {};
return content.mediasSources; return content.mediasSources;

@ -638,7 +638,8 @@ define([
title: Cryptpad.fromFileData.title title: Cryptpad.fromFileData.title
} : undefined, } : undefined,
burnAfterReading: burnAfterReading, burnAfterReading: burnAfterReading,
storeInTeam: Cryptpad.initialTeam || (Cryptpad.initialPath ? -1 : undefined) storeInTeam: Cryptpad.initialTeam || (Cryptpad.initialPath ? -1 : undefined),
supportsWasm: Utils.Util.supportsWasm()
}; };
if (window.CryptPad_newSharedFolder) { if (window.CryptPad_newSharedFolder) {
additionalPriv.newSharedFolder = window.CryptPad_newSharedFolder; additionalPriv.newSharedFolder = window.CryptPad_newSharedFolder;

Loading…
Cancel
Save