GNOME Bugzilla – Bug 319976
Context menu: add "Copy Link Text"
Last modified: 2008-06-30 22:48:12 UTC
Version details: Built from tarball Distribution/Version: Ubuntu 5.10 Summary: When right clicking on a link, there is a context menu entry for copying link address. I find that I almost as often wants to get at the link text (what is displayed). This is often hard and might even in some designs be almost impossible, because one has to start the selection a few pixels beside the link without actually clicking the link. Use case general online forum: In many online forums and boards all names of members, threads and sections are linked, while there might be plenty reason to get the actual names of them. Thread names are often long, and user names are often complex. Use case PHPBB: PHPBB does most administration of users by having the administrator type the name of a user to add her to a group and similar actions. Even though this is a shortcoming in PHPBB, it would be so much easier to just get at the names in a list (or for example "most recent member"). Use case web search: For web searches. In articles and posts on the web, a cross reference to a product, name, document or whatever is often hyperlinked to a specific page, while I might want to make a Google or Wikipedia search for the item/person. Again, it's awkvard and uncomfortable to get at this name if it's linked like that. Suggestion: * Add context menu for links to copy the link text to the clipboard. * Activating copies the plain text result that is displayed in the link to clipboard. * Don't display it if link and text are the same. * Don't diplay it if there is no text available in the link. Rationale: I'm not into long bloated menus usually, but I think this is quite similar to the context menu entries for image links - yes, they are the same as for unlinked images, but imagine the trouble if linked images lost the ability to get at the image just because there's a link around it. This is the same. Linked text loses the ability to be easily accessed for many cases. Workarounds are plenty, but they are annoying and errorprone.
It's possible that this could be implemented by disabled Copy Link Location on the context menu when you press shift (which is what Netscape 4 did). We could help to indicate that this is possible by removing link styles and/or changing the cursor to an I beam. The basic css would be something along the lines of: :link {text-decoration: inherit; font: inherit; color: inherit; background: inherit;} This would only happen when textboxes are not focused. Need to consider how intrusive this would be.
I'm not sure if the shift solution is a good one. I don't think it would be discoverable by most users.
Why not just the Copy Link Text action in the context menu without any reasoning except for images?. Anyway, how do you ask mozilla for the text of the hyperlink you right clicked and where does Ephy asks mozilla for, well, the hyperlink that you clicked.
Good to know I'm not the only one missing the feature! I'm not sure if it helps, but there's a Firefox extension which does exactly that: http://www.borngeek.com/firefox/colt/ https://addons.mozilla.org/en-US/firefox/addon/1812
Created attachment 89729 [details] [review] copy link's text Implements the feature, it doesn't look too good on the popup menu however, don't know if it's something users would like (I would, but who knows others?). Also I don't know why exactly there's always a whitespace in front of the cp'd text. Ideas?
The whitespace might come from the way that we collect the link text in EventContext.cpp. + { "CopyLinkText", NULL, N_("Cop_y Link Text"), NULL, Is no other accel still available? It's not very good to have accels on characters with descent.
I have had this enabled on my ephy build but I have come to dislike it. I'm already used to find copy link address at the bottom of the menu, funny but now I'm against this one.
So anyone oposses my opossition?
Diego, perhaps you could make it an extension for those who want it.
(In reply to comment #7) > I have had this enabled on my ephy build but I have come to dislike it. > I'm already used to find copy link address at the bottom of the menu, funny but > now I'm against this one. > I haven't personally tried this (yet), but is the problem that the new entry is added at the bottom of the menu? Could it simply be moved up one notch, so the old "reflexes" aren't disturbed?
I like this feature, but i think it should not be the last entry of the menu. Maybe making it an extension is really the best thing, as I'm not shure all users would find it useful, and filling contextual menu with loads of options is not a good choice imho.
I agree with Cosimo here. But then I'm not sure it is possible to position it at a given place (say: last but one) in the contextual menu.
Yes, we just move the line in the ui file. Pretty simple. We can try this patch in trunk if you want. I miss this only when marking dupes in Bugzilla. What do you think
+ { "CopyLinkText", NULL, N_("Cop_y Link Text"), NULL, + NULL, G_CALLBACK (popup_cmd_copy_link_text) }, @@ -1953,6 +1955,9 @@ update_popups_tooltips (EphyWindow *wind + action = gtk_action_group_get_action (group, "CopyLinkText"); + g_object_set (action, "tooltip", _("Copy link's text"), NULL); Why not just set the tooltip in the GtkActionEntry struct directly here?
Created attachment 101603 [details] [review] 20071225_bgo_319976_copy-link-text.diff: Updated to trunk Updated following last comments, are we gonna try this?
**PING** - patch is set to "accepted commit after freeze" for half a year now. Please do decide before we're under freeze again. Thanks.
When I want to start a selection in a link, sometimes I want to copy all the link text and nothing more. But other times I want to copy just some of the link text. And still other times I want to copy the link text plus some of the text next to it (for example, I want to copy the text of a series of adjacent links). So a "Copy Link Text" item would help only occasionally. I agree with the idea in comment 1 of making links temporarily inactive when Shift is held down. Yes, it wouldn't be very discoverable, but that's quite okay, because it's a very obscure function. It's the sort of function -- like Ctrl+clicking on a bookmark -- that is fine to present only in help pages and "Ten cool things you didn't know about Epiphany" Weblog posts.