quoid / userscripts

An open-source userscript manager for Safari
https://quoid.github.io/userscripts/
GNU General Public License v3.0
3.34k stars 191 forks source link

Deprecate `GM.setClipboard` API #655

Open ACTCD opened 6 months ago

ACTCD commented 6 months ago

Since document.execCommand() has been deprecated and has unstable behavior in iOS Safari (https://github.com/quoid/userscripts/issues/285).

the clipboard can only be accessed if the user then explicitly interacts with the platform UI (ref)

We believe that in most cases, accessing the clipboard should be included in the user interaction behavior.

So we encourage using the new Clipboard API directly, and the GM.setClipboard API will no longer needed.

We plan to deprecate it in the future unless we receive use cases sufficient to consider extending support. Maybe add a deprecation prompt in v5.0 and then remove in the v6.0.

masklinn commented 1 month ago

If the commands already have a replacement (as is the case for this one), maybe they could be pre-deprecated by marking them as deprecated in the readme already, with the alternate API being listed? That way users would at least not be incentivised to use those APIs for new snippets.

ACTCD commented 1 month ago

@masklinn Yes, that's what we're going to do.