Establish communication with the client from Electron
lipis opened this issue · comments
Lipis commented
For example we need a special case when exporting scenes via shareable URL
Jed Fox commented
Here’s the event for receiving an opened file: https://www.electronjs.org/docs/api/app#event-open-file-macos.
I think we might want to export a global object from the main app like so:
globalThis.__EXCALIDRAW_API_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
openFile(blob) { ... },
onDragToExport(...) { ... }, // drag & drop the preview image out of the export window perhaps?
onOpenInDesktop(data) { ... }, // maybe add a button in the web app that switches your current drawing to the desktop app?
// etc
}