Deprecate `GM.setClipboard` API
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.
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.
@masklinn Yes, that's what we're going to do.
Wouldn't this go against compatibility with userscripts that work in, say, Violentmonkey?
Can't it be reimplemented with or be an alias of the modern API?
Wouldn't this go against compatibility with userscripts that work in, say, Violentmonkey?
This "compatibility" is broken and deprecated by upstream and we cannot resolve it.
Can't it be reimplemented with or be an alias of the modern API?
No, it only leads people to mistakenly think that it works the way it was, but that's not true.
People have to read the documentation for the new API and use it as required conditions.