User talk:Isaacl/script/copy-comment-link-to-clipboard
Appearance
Some suggestions
[edit]Hi @Isaacl, some suggestions for your script:
- Rather than manually triggering the script with the link in the toolbox, I wouldn't mind having it automatically run. Some discussions can get very long, and scrolling up to the tools menu to turn it on, then back down means you lose your place. I believe the
</>
button is small enough that this wouldn't be intrusive. - Speaking of the buttons, I think they could be positioned after the timestamp rather than at the start of the comment. Clicking the timestamp copies the comment's full URL, and putting this similar functionality next to it makes sense to me.
- Is it possible to add an option to hide the popup containing the plain text?
- Re: browser support – your script currently works fine for me in desktop Safari 18.2, ie. the wikitext is written to the clipboard on button click. Maybe it was fixed at some point?
Iiii I I I (talk) 22:35, 9 January 2025 (UTC)
- Thanks for the comments! Currently I don't have any plans to revisit the implementation; if that changes, then I'll consider user interface changes. I now use the popup to display two forms of permalinks – one using the
Special:GoToComment
page, and one using the original page – as I like having both available to choose from. So I'm not inclined yet to hide the popup. - Thanks for the note on Safari. Starting with version 13.1 (13.4 on iOS), Safari supports the clipboard
writeText()
API under certain circumstances. I appreciate your report that the appropriate conditions seem to be met for the API call to work in the event handlers set up by my script. So while this falls short of supporting all browsers classified by the MediaWiki development team as Grade A, it's likely to be a significant portion of the affected population. Just curious: I didn't see any changes to your common.js file; did you test the script elsewhere? isaacl (talk) 03:29, 10 January 2025 (UTC)- Good catch, I didn't add it to my personal JS, I was just testing it through the console on different talk pages. Thanks for considering this - no pressure to implement anything. Iiii I I I (talk) 04:56, 10 January 2025 (UTC)