mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
upd: handle onbeforeunload on electron for drawio editor
This commit is contained in:
@@ -276,6 +276,12 @@ function buildEditorSrcdoc (file: Doc) {
|
||||
iframe.style.border = 'none'
|
||||
iframe.setAttribute('frameborder', '0')
|
||||
|
||||
${isElectron ? `
|
||||
window.onbeforeunload = evt => {
|
||||
iframe.contentWindow.postMessage(JSON.stringify({ action: 'exit' }), '*');
|
||||
}
|
||||
` : ''}
|
||||
|
||||
const asPng = doc.path.endsWith('.png')
|
||||
|
||||
const receive = async function (evt) {
|
||||
|
||||
Reference in New Issue
Block a user