[aur-general] AUR ssh:// click-to-copy URLs don't work
Henry-Joseph Audéoud
h.audeoud+arch at gmail.com
Mon Mar 7 14:28:34 UTC 2022
Hi all,
On 07/03/2022 11:02, Mikhail f. Shiryaev via aur-general wrote:
> Hello mpan.
>
>> You have not mentioned any specific example that would allow anyone
>> to investigate the issue.
>
> Every package page I checked is affected by the issue, but let's take
> https://aur.archlinux.org/packages/zoom specifically. […] https:// click-to-copy links work. ssh:// don't.
Looking into `https://aur.archlinux.org/static/js/copy.js`:
document.querySelector('.copy').addEventListener( [...]
This only applies to the first element with class "copy", so only the
HTTP link. My firefox inspector confirms that SSH link does not have an
event recorded on it.
Manually issuing that command in the browser console makes both links
working:
document.querySelectorAll('.copy').forEach(
element => element.addEventListener('click', function(e) {
e.preventDefault();
navigator.clipboard.writeText(event.target.text);
})
);
--
Henry-Joseph Audéoud
audeoudh
More information about the aur-general
mailing list