aecreations / clippings

Clippings: an extension for Mozilla Firefox
20 stars 4 forks source link

New from clipboard #94

Open aecreations opened 6 years ago

aecreations commented 6 years ago

Clippings 6.0a1-pre on Firefox 56.0b12

Can't get clipboard paste to work even after following this MDN article. document.execCommand("paste") doesn't do anything, even when the clipping content \<textarea> in Clippings Manager is focused. But it works when Clippings is running in Google Chrome.

This feature will be postponed till later.

aecreations commented 1 month ago

Creating a new clipping from clipboard is possible using the Clipboard API[1]. This will require adding an additional permission to the extension manifest; see the linked documentation for the permissions that need to be requested.

This was implemented in Clippings for Thunderbird as part of the work to migrate from legacy XUL to the MailExtensions API - see https://github.com/aecreations/clippings-tb/issues/157.

-- [1] https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API

aecreations commented 1 month ago

Caveat: The ability to read from the clipboard using the Clipboard API is new, and requires minimum version 122 of Firefox, though it is officially supported starting in version 125; see https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText.

aecreations commented 1 month ago

Remaining work: Put the clipboard permission prompt in a proper modal dialog.