After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319976 - Context menu: add "Copy Link Text"
Context menu: add "Copy Link Text"
Status: RESOLVED NOTGNOME
Product: epiphany
Classification: Core
Component: Interface
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on: 332968
Blocks:
 
 
Reported: 2005-10-27 12:37 UTC by Kristoffer Lundén
Modified: 2008-06-30 22:48 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
copy link's text (2.76 KB, patch)
2007-06-11 06:07 UTC, Diego Escalante Urrelo (not reading bugmail)
needs-work Details | Review
20071225_bgo_319976_copy-link-text.diff: Updated to trunk (2.44 KB, patch)
2007-12-26 01:41 UTC, Diego Escalante Urrelo (not reading bugmail)
accepted-commit_after_freeze Details | Review

Description Kristoffer Lundén 2005-10-27 12:37:58 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.
Comment 1 spark 2005-11-14 20:39:13 UTC
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.
Comment 2 lexual 2006-08-14 22:19:21 UTC
I'm not sure if the shift solution is a good one. I don't think it would be discoverable by most users.
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2007-01-17 12:29:28 UTC
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.
Comment 4 Leonardo Ferreira Fontenelle 2007-06-11 04:44:07 UTC
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
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2007-06-11 06:07:26 UTC
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?
Comment 6 Christian Persch 2007-06-11 10:51:27 UTC
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.
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2007-07-05 00:56:55 UTC
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.
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2007-07-25 03:24:45 UTC
So anyone oposses my opossition?
Comment 9 Reinout van Schouwen 2007-07-25 08:10:07 UTC
Diego, perhaps you could make it an extension for those who want it.
Comment 10 Kristoffer Lundén 2007-07-25 08:29:55 UTC
(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?
Comment 11 Cosimo Cecchi 2007-07-27 12:22:58 UTC
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.
Comment 12 Cyril Brulebois 2007-09-06 13:02:56 UTC
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.
Comment 13 Diego Escalante Urrelo (not reading bugmail) 2007-09-28 06:52:18 UTC
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
Comment 14 Christian Persch 2007-12-24 18:26:20 UTC
+	{ "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?
Comment 15 Diego Escalante Urrelo (not reading bugmail) 2007-12-26 01:41:35 UTC
Created attachment 101603 [details] [review]
20071225_bgo_319976_copy-link-text.diff: Updated to trunk

Updated following last comments, are we gonna try this?
Comment 16 André Klapper 2008-06-29 02:48:52 UTC
**PING** - patch is set to "accepted commit after freeze" for half a year now. Please do decide before we're under freeze again. Thanks.
Comment 17 Matthew Paul Thomas (mpt) 2008-06-30 22:48:12 UTC
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.