Download current document outside the iframe of OnlyOffice

Hello,
You are referring to Docs Editor, right?
You can use this Command Service method to save the current version of the edited document without closing it: forcesave | ONLYOFFICE. You can link function sending the forcesave request to your custom button. Here you can learn more about the logic of forcesave: Saving file | ONLYOFFICE. You can monitor the status 6 message sent to the callback and add your own events that would be triggered each time the saving occurs.