pgcode icon indicating copy to clipboard operation
pgcode copied to clipboard

Feature request: support drag&drop of files from Fluidd when running as embedded iFrame

Open MarSoft opened this issue 2 years ago • 2 comments

I've configured pgcode as a "webcam" within my Fluidd instance. It shows nice, but when I drag&drop the file from File Browser window to PrettyGCode frame, nothing happens. It would be nice to be able to open files by URL using drag&drop, not just local files. This can be done by changing drop event handler to not only rely on dataTransfer.files object but also call dataTransfer.getData('text') and check if the result looks like a URL (starts with either http:// or https://).

Support for drag&drop from Fluidd would also require a change on the Fluidd side — for now it does not add file URL to the drag&drop event; I've posted it at https://github.com/fluidd-core/fluidd/issues/1202 But the change I've described will let you to drag&drop any hyperlink to Gcode file (provided that the server gives permissive CSRF headers).

MarSoft avatar Oct 05 '23 13:10 MarSoft

@MarSoft - how did you get PGC to show up as a webcam? Notably, I'm running MainSail instead of Fluidd, but shouldn't they both handle it the same if PGC is running as a "webcam"?

twoscoopsofpig avatar Mar 04 '24 22:03 twoscoopsofpig

Nevermind, I found where Fluidd handles this. Looks like it's a Fluidd-only thing unless I can hack it together myself.

twoscoopsofpig avatar Mar 04 '24 22:03 twoscoopsofpig