Read clipboard data on button click

Hi folks! From my understanding, plugins cannot access window.clipboardData or navigator.clipboard. And so the only way to read clipboard data from a button click is to use window.execCommand("paste") and listen for paste events.

While this approach works fine when running Figma via the desktop app, it will not work reliably when running Figma from within a browser (as window.execCommand has been deprecated).

I’m wondering if there are alternative methods to reading clipboard data that will work reliably in both the desktop app and within browsers.

Thank you!

1 Like