Open anarcat opened 8 months ago
Hi! I had difficulty following a long in the video, unfortunately. Can you describe with words what you do, what happens, and what you expected to happen?
sure, sorry. :) in the tutorial, I hit alt-shift-l which I understand means "select link", then i hit alt-j to copy the URL of the Almost there
button. Then I focus on my terminal to try to paste the URL there, but it pastes whatever was already present in the clipboard.
Note that i can properly copy selected text with alt-shift-l on other places. Like if I do alt-shift-l then c, this text gets selected:
AltShiftL lets you select elements. This is useful for copying text and using the context menu.
and I can hit control-c to copy it to my clipboard. But that doesn't work to copy the link.
alt-shift-l does not mean “select link” – it means “select element”. Basically, it lets you select the text of any element. On top of that, there’s one more thing. If you hold alt while typing the last hint character of an element, that element is copied in a “do what I mean” fashion. It usually means that the text of the element is copied, but for links it means that the link URL is copied.
On 2024-03-21 09:39:07, Simon Lydell wrote:
[...] It usually means that the text of the element is copied, but for links it means that the link URL is copied.
Right, so this is what this bug report is about: copying link URLs doesn't work. :)
As in, nothing at all is copied?
Also – it’s not about links, right? The same problem happens if you try to copy element text by holding alt during the last hint character?
On 2024-03-21 11:44:10, Simon Lydell wrote:
As in, nothing at all is copied?
correct.
Also – it’s not about links, right? The same problem happens if you try to copy element text by holding alt during the last hint character?
no! i can copy text elements by doing that.
in fact, interestingly, it works for some links. for example, in:
https://lydell.github.io/LinkHints/tutorial.html#step-7
i can copy the "home" link but not the "Almost there" link - maybe it's because it's a button?
Ah, then it sounds like you’re encountering this bug: https://github.com/lydell/LinkHints/issues/85
If you can’t copy elements with just one hint letter, then it’s that bug.
aaaah that could explain it then, thanks! Let's close this one and i'll reopen if i can find a case where it doesn't work with two letters. :)
(is there a a workaround? forcing two characters everywhere maybe? :)
(one thing i was hoping this could do would be to pop open the right-click menu on a link, that way i would have access to all sorts of other things as well...)
is there a a workaround?
Unfortunately not. But luckily Link Hints is finally at the top of my todo list again, so hopefully I can fix it somewhat soon.
one thing i was hoping this could do would be to pop open the right-click menu on a link, that way i would have access to all sorts of other things as well...
That would be awesome. It was possible in Firefox back in the day, but since they switched to “Web Extensions” it is sadly not possible anymore. However, you can still use alt-shift-l to focus elements and then press the right-click key on your keyboard (if it has one – if not, you can probably solve that since you’re on Linux).
just a quick note here to mention that i thought i had reproduced this here (failure with two-letter hints) but i think what happened is i held alt while typing both letters. it works if i type alt-shift-l then the first letter of the hint, then hold alt while I type the second letter, which is a bit confusing...
also, maybe that could explain why it doesn't work with a single letter?
which is a bit confusing...
Sorry, I didn’t quite following along. What was confusing exactly?
maybe that could explain why it doesn't work with a single letter?
That’s called solving the bug 😉
Sorry, I didn’t quite following along. What was confusing exactly?
Maybe I misunderstand, but if I type alt-shift-l then hold alt while typing the two letters for a hint, the copying doesn't work. If I type the first letter, then hold alt then type the second letter, it works.
I find that confusing because I would expect I could just hold alt the whole time and it would work, releasing alt feels counter-intuitive.
Oh, yeah, that’s weird. Looks like you found another bug.
Tried to debug it today. When the bug happens, this is printed in the console:
WorkerProgram#onMessage->CopyElement->clipboard.writeText DOMException: Clipboard write was blocked due to lack of user activation.
Browsers only allow certain actions to be done “during a user activation”, such as during a key press. We are doing it during a key press, so it should be fine, but Firefox seems a bit twitchy. Things I learned:
Not sure what to do about this, leaving it for another time.
URL
https://lydell.github.io/LinkHints/tutorial.html#step-7
Screen shot
Here's a screenshot of the tutorial before selecting the link:
Here's a video of the procedure. Note that control-shift-v in the terminal pastes from the
CLIPBOARD
selection, but thePRIMARY
selection is also not correct.https://github.com/lydell/LinkHints/assets/796623/106456bb-6e5d-49e4-8600-aa65a28cfcff
Description
Copying links doesn't work in Firefox 115.8.0esr on Debian 12 "bookworm", running under Sway.
Debug info