I'm working on a plugin where we rely on the user's ability to drag-and-drop an image from our Google Docs plugin sidebar to their current Google Document, inserting it in the document when they drop.
This has worked fine up till now using HtmlService.SandboxMode.NATIVE
, as the browser implements this natively, but that sandbox mode will soon be sunsetted in favor of HtmlService.SandboxMode.IFRAME
.
In iFrame sandbox mode, this no longer works, as dragging and dropping between iFrames is disallowed by browser security.
I initially thought we might be able fake this by catching an event on drop, and inserting the image at the user's cursor location, but we're not getting any events for the drag and drop over the document.
It doesn't look like window messaging is an option.
Has anyone dealt with this or a similar situation? Any insight into how we might either a) make drag and drop work, or b) fake it?