Hi,
I’m trying to post message to a iframe containing Collabora document.
The frame is OK And I receive some messages :
==== receiveMessage: {“MessageId”:“Views_List”,“SendTime”:1648153588752,“Values”:[{“ViewId”:“0”,“UserName”:“eagerCoati3”,“UserId”:“eagerCoati3”,“Color”:411298,“ReadOnly”:“0”,“IsCurrentView”:true}]} iframe:71:10
==== receiveMessage: {“MessageId”:“Doc_ModifiedStatus”,“SendTime”:1648153588765,“Values”:{“Modified”:false}}
I Try to post the Host_postmessagesReady (But I don’t know if it is OK - I can see the message in the console ==> the post is done !) :
if (msg.Values.Status == ‘Document_Loaded’) {
console.log(’==== inform the wopi client that we are ready to receive messages’);
var iframe = document.getElementById(‘inlineFrame’);
iframe = iframe.contentWindow || (iframe.contentDocument.document || iframe.contentDocument);
iframe.postMessage(JSON.stringify({ ‘MessageId’: ‘Host_PostmessageReady’ }), '’);
}
But if I try to post something else Close or Save for example : Nothing. ==> No response and nothing in the logs (coolwsd and wopi).
The src for save function :
function save() {
console.log(‘save the document…’);
post({
“MessageId” : “Action_Save”,
“Values” : {
“DontTerminateEdit” : true,
“DontSaveIfUnmodified”: false,
“Notify” : true
}
});
}
function post(msg) {
console.log("==== sending new message : " + JSON.stringify(msg));
var iframe = document.getElementById(‘inlineFrame’);
iframe = iframe.contentWindow || (iframe.contentDocument.document || iframe.contentDocument);
iframe.postMessage(JSON.stringify({ ‘MessageId’: ‘Host_PostmessageReady’ }), ‘’);
iframe.postMessage(JSON.stringify(msg), '’);
}
Console :
==== sending new message : {“MessageId”:“Action_Save”,“Values”:{“DontTerminateEdit”:true,“DontSaveIfUnmodified”:false,“Notify”:true}}
I don’t know how I can start coolwsd in debug mode to have some log to see what is going wrong !
I’ve also tried whith the framed.doc.html (online/framed.doc.html at master · LibreOffice/online · GitHub) with a modified uribase → Same results.
Wopi and coolwsd are on the same server - Everybody (client and server) is on the same LAN without Firewall.
Regards