Fix secureiframe in dev instance

pull/1/head
yflory 3 years ago
parent 56114cd646
commit b7f5018ff8

@ -1511,26 +1511,38 @@ define([
var _mediasSources = getMediasSources(); var _mediasSources = getMediasSources();
var images = _obj.data || []; var images = _obj.data || [];
if (!Array.isArray(images)) { return; } if (!Array.isArray(images)) { return; }
var urls = images.map(function (name) { var urls = [];
var data = _mediasSources[name]; nThen(function (waitFor) {
if (!data) { return; } images.forEach(function (name) {
var media = mediasData[data.src]; if (/^data\:image/.test(name)) {
if (!media) { return; } Util.fetch(name, waitFor(function (err, u8) {
return { if (err) { return; }
path: name, var b = new Blob([u8]);
url: media.blobUrl, urls.push(URL.createObjectURL(b));
}; }));
}).filter(Boolean); return;
send({ }
type: "documentOpen", var data = _mediasSources[name];
data: { if (!data) { return; }
type: "imgurls", var media = mediasData[data.src];
status: "ok", if (!media) { return; }
urls.push({
path: name,
url: media.blobUrl,
});
});
}).nThen(function () {
send({
type: "documentOpen",
data: { data: {
urls: urls, type: "imgurls",
error: 0 status: "ok",
data: {
urls: urls,
error: 0
}
} }
} });
}); });
} }
break; break;

@ -1,5 +1,12 @@
define([], function () { define([], function () {
if (window.__CRYPTPAD_TEST_OBJ_) { return window.__CRYPTPAD_TEST_OBJ_; } if (window.__CRYPTPAD_TEST_OBJ_) { return window.__CRYPTPAD_TEST_OBJ_; }
// XXX localhost secureiframe fix
var out = function () {};
out.options = {};
out.testing = false;
out.registerInner = function () { };
out.registerOuter = function () { };
return out;
var locks = []; var locks = [];
var tests = []; var tests = [];

Loading…
Cancel
Save