diff --git a/www/common/boot2.js b/www/common/boot2.js index 599875a93..d894191e8 100644 --- a/www/common/boot2.js +++ b/www/common/boot2.js @@ -10,5 +10,13 @@ define([], function () { "json.sortify": "/bower_components/json.sortify/dist/JSON.sortify" } }); + + // most of CryptPad breaks if you don't support isArray + if (!Array.isArray) { + Array.isArray = function(arg) { // CRYPTPAD_SHIM + return Object.prototype.toString.call(arg) === '[object Array]'; + }; + } + require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]); }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index f91069286..e6a48ebe2 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1269,7 +1269,7 @@ define([ feedback("NO_PROXIES"); } - if (typeof(Array.isArray) !== 'function') { + if (!/CRYPTPAD_SHIM/.test(Array.isArray.toString())) { feedback("NO_ISARRAY"); }