|
|
@ -74,34 +74,6 @@ define([
|
|
|
|
return JSONSortify(obj);
|
|
|
|
return JSONSortify(obj);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Chrome 92 dropped support for SharedArrayBuffer in cross-origin contexts
|
|
|
|
|
|
|
|
where window.crossOriginIsolated is false.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Their blog (https://blog.chromium.org/2021/02/restriction-on-sharedarraybuffers.html)
|
|
|
|
|
|
|
|
isn't clear about why they're doing this, but since it's related to site-isolation
|
|
|
|
|
|
|
|
it seems they're trying to do vague security things.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In any case, there seems to be a workaround where you can still create them
|
|
|
|
|
|
|
|
by using `new WebAssembly.Memory({shared: true, ...})` instead of `new SharedArrayBuffer`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This seems unreliable, but it's better than not being able to export, since
|
|
|
|
|
|
|
|
we actively rely on postMessage between iframes and therefore can't afford
|
|
|
|
|
|
|
|
to opt for full isolation.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
var supportsSharedArrayBuffers = function () {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
return Object.prototype.toString.call(new window.WebAssembly.Memory({shared: true, initial: 0, maximum: 0}).buffer) === '[object SharedArrayBuffer]';
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
console.error(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var supportsXLSX = function () {
|
|
|
|
|
|
|
|
return !(typeof(Atomics) === "undefined" || !supportsSharedArrayBuffers() /* || typeof (SharedArrayBuffer) === "undefined" */ || typeof(WebAssembly) === 'undefined');
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var toolbar;
|
|
|
|
var toolbar;
|
|
|
|
var cursor;
|
|
|
|
var cursor;
|
|
|
|
|
|
|
|
|
|
|
@ -1553,8 +1525,10 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
if (APP.isDownload) {
|
|
|
|
if (APP.isDownload) {
|
|
|
|
var bin = getContent();
|
|
|
|
var bin = getContent();
|
|
|
|
|
|
|
|
if (!supportsXLSX()) {
|
|
|
|
|
|
|
|
return void sframeChan.event('EV_OOIFRAME_DONE', bin, {raw: true});
|
|
|
|
|
|
|
|
}
|
|
|
|
x2tConvertData(bin, 'filename.bin', file.type, function (xlsData) {
|
|
|
|
x2tConvertData(bin, 'filename.bin', file.type, function (xlsData) {
|
|
|
|
var sframeChan = common.getSframeChannel();
|
|
|
|
|
|
|
|
sframeChan.event('EV_OOIFRAME_DONE', xlsData, {raw: true});
|
|
|
|
sframeChan.event('EV_OOIFRAME_DONE', xlsData, {raw: true});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|