thanhnguyen2187 / crypta

An offline-first code snippet manager
https://thanhnguyen2187.github.io/crypta/
MIT License
7 stars 0 forks source link

Firefox issue: `navigator.clipboard.readText is not a function` #47

Closed thanhnguyen2187 closed 9 months ago

thanhnguyen2187 commented 9 months ago

image

thanhnguyen2187 commented 9 months ago

It is because navigator.clipboard.read is not supported in Firefox yet.

However, while navigator.clipboard.readText() and navigator.clipboard.writeText() work on all browsers, navigator.clipboard.read() and navigator.clipboard.write() do not. For example, on Firefox at the time of writing, navigator.clipboard.read() and navigator.clipboard.write() are not fully implemented...

Source: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard


EDIT: the error is with navigator.clipboard.readText.

thanhnguyen2187 commented 9 months ago

It might conflict with #46, where we also want to paste an image sometimes.

Solution: add the "holding down" interaction to the add snippet button.

thanhnguyen2187 commented 9 months ago

Toggling these values of Firefox's about:config works: