display-anchors icon indicating copy to clipboard operation
display-anchors copied to clipboard

Feature request - copy and hide after click

Open Juraj-Masiar opened this issue 5 years ago • 7 comments

Hello Rob,

To save user some time, I would suggest you to add option to "On click - copy to clipboard and close". Basically after clicking any of the shown anchors, it would copy the URL to clipboard and closed all shown anchors.

Thank you for making this addon without <all_urls> permission!

Juraj-Masiar avatar Feb 20 '20 07:02 Juraj-Masiar

I usually spend some time to find a good anchor (some pages have multiple, some anchors are not stable), and then copy the link.

In that workflow, an option to copy and remove the anchors doesn't add much.

I do recognize that others may have a different workflow. After explaining how I use my extension, do you still think that there is value in introducing an option to replace the default behavior with copy and close with one click?

Rob--W avatar Feb 22 '20 02:02 Rob--W

Hello again. I'm sorry for the delay, I've been sick for a week now.

Well, usually what I need is to send someone link that will point him to a specific part of the page (usually some MDN docs with nice ID anchors). So in this case it would really save a lot of steps (click, copy url, hide the links). Maybe you could enable it with some modifier key, like "Ctrl + click" would copy and close.

Anyway, let's keep this open for some time to see what others think about it. I certainly don't want you to spent time with something that no one will use.

Juraj-Masiar avatar Feb 27 '20 17:02 Juraj-Masiar

You can already use a shortcut to toggle the anchors, defaulting to Alt-Shift-A. Would that help with your use case?

Rob--W avatar Feb 27 '20 17:02 Rob--W

Yes I know, I've been using it. It does help to speed-up things :). Anyway, if you don't see a benefit in what I'm proposing, then let it be. It's not the end of the world. I'm still grateful for all those addons you've created and I'm sure you are working on something cool right now and I'm only a distracting you here.

Let it be for a half a year to see what community thinks about it.

Juraj-Masiar avatar Feb 27 '20 17:02 Juraj-Masiar

Yes I know, I've been using it. It does help to speed-up things :). Anyway, if you don't see a benefit in what I'm proposing, then let it be. It's not the end of the world. I'm still grateful for all those addons you've created and I'm sure you are working on something cool right now and I'm only a distracting you here.

Let it be for a half a year to see what community thinks about it.

@Juraj-Masiar My workflow is more similar to yours, and I would also like this function. That being said, this is a pretty simple extension and I think I might be able to implement it myself. I'm forking this extension right now to see if I can make it work...

e-t-l avatar Oct 21 '21 21:10 e-t-l

Alright @Rob--W I'm admitting (temporary) defeat... I thought I had this one but it's not working when I test it and I'm not sure why (specifically, the thing that isn't working is toggle-anchors.js, as far as I can tell. When I hit alt+shift+A, nothing happens. No idea what's preventing it from showing the anchors).

Here are the blame views showing what I added in... toggle-anchors.js options.js options.html background.js

(Let me know if it would be easier to review code in a PR and I'll submit one. Conversely, let me know if this is annoying and want me to piss off. Since you know your code better than anyone else, I'm sure you would've been able to implement this a lot more quickly and easily)

e-t-l avatar Oct 27 '21 01:10 e-t-l

Just a quick note. I haven't had time to think about your comment, but I noticed the use of navigator.clipboard in your code @e-t-l . That API is only available on https:-pages, so it wouldn't work on http:-pages.

Rob--W avatar Nov 01 '21 00:11 Rob--W