Closed Bug 664798 Opened 13 years ago Closed 13 years ago

Add "Copy email address" and "View image" (or "Copy image location") to the Fennec context menu

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 9

People

(Reporter: CoJaBo-Bugzilla, Assigned: murshyam)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
Build Identifier: Fennec 7

Fennec is missing the long-press actions "Copy Link URL", "Copy Image URL", and "View Image" as present in other desktop and mobile browsers. Primarily, this makes it quite difficult to share links via copy/paste, particularly images where the only work-around appears to be to open the page in another browser.

(unrelated nitpick, but why is the "Android" OS and associated hardware platform only available to select after the bug is submitted?)

Reproducible: Always
part of this is a duplicate of bug 643191
Yes it's a dupe.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Er, how is a bug encompassing a broader issue a dupe of one that mentions only one part of that issue?
"Copy Link" is added by bug 643191, but the rest of this bug is still valid.  Reopening.

I agree that "View Image" or "Copy Image Location" would be useful.  If we want to minimize clutter we could consider adding just one of them, since either one provides a work-around for the other.

"Copy Email Address" is another one that would be useful to add, and would not contribute much to clutter since it would show up only on mailto: links.
Status: RESOLVED → REOPENED
Ever confirmed: true
Keywords: uiwanted
Resolution: DUPLICATE → ---
"View Image" might be a useful shortcut in some cases, but could be stricken if clutter is really an issue, as it is not as likely to be used as copying an image link (and could be emulated by copying the link and pasting it manually).
Actually, the only times I can recall personally using "View Image" (in other mobile browsers) were to work around issues like Bug 653947 that prevent zooming.
OS: Other → All
Hardware: Other → All
Summary: Missing long-press actions → Add "Copy email address" and "View image" (or "Copy image location") to the Fennec context menu
In the vein of "copy email address" (sidenote: would we / could we ever add "add to address book?) when on a mailto:, could we add "call phone number" to tel: links?

Just for the sake of really thinking it through, what use case are we supporting with "view image" or "copy image location." Remember, we can save to the gallery and share the image already.
Copy Image Link (or Location or URL, whichever wording is preferred) would be useful to share an image link by clipboard, such as to paste it into another page or app- this is not currently possible without a tedious and non-obvious workaround (Long-press -> Share Image -> Text Messaging -> Focus input -> Long-press -> Select all -> Long-press -> Cut -> Back button -> Back button) as opposed to just doing Long-press -> Copy Image Link is this bug is requesting.
View Image is useful primarily as a workaround to Bug 653947 (which prevents, e.g., zooming in on a picture in an article on most news sites). It could be omitted if clutter is a concern.

"Copy Email Address" and "Copy Phone Number" would indeed be helpful too, to make it fully consistent. These could presumably replace the "Copy Link" option on mailto: and tel: links. In fact, most of the other menu options there are irrelevant too- is there any reason we'd ever need to bookmark a mailto: link or open a tel: link in a new tab?
(and are there any other such special cases? I've never seen tel: before)
Status: REOPENED → NEW
Whiteboard: [mentor=mbrubeck@mozilla.com][good first bug]
(In reply to CoJaBo from comment #7)
> "Copy Email Address" and "Copy Phone Number" would indeed be helpful too, to
> make it fully consistent. These could presumably replace the "Copy Link"
> option on mailto: and tel: links. In fact, most of the other menu options
> there are irrelevant too- is there any reason we'd ever need to bookmark a
> mailto: link or open a tel: link in a new tab?

Yes - as part of this bug, let's add specialized actions for mailto: and tel: links, and also hide "Bookmark link" and other irrelevant options for those links (unless someone has a good use case for keeping them).

(In reply to Madhava Enros [:madhava] from comment #6)
> In the vein of "copy email address" (sidenote: would we / could we ever add
> "add to address book?)

Yes, it looks like we can do for tel: and mailto: with the SHOW_OR_CREATE_CONTACT intent:
http://developer.android.com/reference/android/provider/ContactsContract.Intents.html#SHOW_OR_CREATE_CONTACT

Let's file a new bug for that.

> when on a mailto:, could we add "call phone number" to tel: links?

Yes, but "call phone number" is the default action when tapping a tel: link, so this seems unnecessary.  (Maybe it would be useful for discoverability though?)

> Just for the sake of really thinking it through, what use case are we
> supporting with "view image" or "copy image location." Remember, we can save
> to the gallery and share the image already.

I often want to paste an image link to apps or web pages that don't support the "share" option, like Bugzilla forms or blog comments or emails with more than one link.
(In reply to Matt Brubeck (:mbrubeck) from comment #8)

> Yes - as part of this bug, let's add specialized actions for mailto: and
> tel: links, and also hide "Bookmark link" and other irrelevant options for
> those links (unless someone has a good use case for keeping them).

Didn't we add "Bookmark Link" to allow for bookmarklets? Couldn't we just limit "Bookmark Link" to javascript: links?

> (In reply to Madhava Enros [:madhava] from comment #6)
> > In the vein of "copy email address" (sidenote: would we / could we ever add
> > "add to address book?)
> 
> Yes, it looks like we can do for tel: and mailto: with the
> SHOW_OR_CREATE_CONTACT intent:
> http://developer.android.com/reference/android/provider/ContactsContract.
> Intents.html#SHOW_OR_CREATE_CONTACT
> 
> Let's file a new bug for that.
> 
> > when on a mailto:, could we add "call phone number" to tel: links?

Just noting: Adding backend support for some types doesn't mean we need to expose through the UI. That's why add-ons exists :)
(In reply to Matt Brubeck (:mbrubeck) from comment #8)
> (In reply to Madhava Enros [:madhava] from comment #6)
> > when on a mailto:, could we add "call phone number" to tel: links?
> 
> Yes, but "call phone number" is the default action when tapping a tel: link,
> so this seems unnecessary.  (Maybe it would be useful for discoverability
> though?)
I actually read that as adding a "copy phone number" option (which would be a good idea, see Comment #7).
It might be nice though to have all the default options (Open, Email, Call, etc) listed too-
most other browsers do this and it is a bit strange to have an extended menu that doesn't have the default action listed first. Also, I cant even count the number of times I've accidentally long-pressed and had to close the menu and try again rather than just clicking said option, and it also proves useful when trying to "preview" where a link goes by long-pressing and looking at the URL before actually opening it. I could file another bug for this (as it isn't really the same scope as this one)- but would anyone else find such a feature useful?
Blocks: 684380
(In reply to Madhava Enros [:madhava] from comment #6)
> In the vein of "copy email address" (sidenote: would we / could we ever add
> "add to address book?) when on a mailto:, could we add "call phone number"
> to tel: links?

Filed bug 684380.
Assignee: nobody → murshyam
Status: NEW → ASSIGNED
Whiteboard: [mentor=mbrubeck@mozilla.com][good first bug]
For this bug, let's do the following (unless Madhava objects):
* Add "Copy email address" for mailto: links
* Add "Copy phone number" for tel: links
* Add "View image" for images

Any other work can be happen in separate bugs.
(In reply to Matt Brubeck (:mbrubeck) from comment #12)
> For this bug, let's do the following (unless Madhava objects):
> * Add "View image" for images

Copy image url is the more typical use case- be sure to implement that at least.
(In reply to CoJaBo from comment #13)
> Copy image url is the more typical use case- be sure to implement that at
> least.

Yes, that's probably true.  So let's change the plan to:

* Add "Copy email address" for mailto: links
* Add "Copy phone number" for tel: links
* Add "Copy image location" for images
Comment on attachment 560583 [details] [diff] [review]
Added 'Copy Email Address', 'Copy Phone Number' and 'Copy Image Location' to the context menu

>+    let isEmail = (ContextHelper.popupState.linkProtocol == "mailto") ? true : false;
>+    if (isEmail) {

You can remove these lines, because we should already be checking this in content.js before this function is called.

>+    let isPhone = (linkProtocol == "tel" || linkProtocol == "callto" || linkProtocol == "sip" || linkProtocol == "voipto") ? true : false;
>+    if (isPhone) {

>+    let isImageType = (ContextHelper.popupState.types.indexOf("image") >= 0) ? true : false;
>+    if (isImageType) {

Same here.

Everything else looks perfect.  Please try removing the above lines, test that it still works, and submit a new patch for review if it does.  Thank you!
Attachment #560583 - Flags: review?(mbrubeck) → review-
Incorporated Code Review comments from comment #16.
Attachment #560583 - Attachment is obsolete: true
Attachment #560682 - Flags: review?(mbrubeck)
Comment on attachment 560682 [details] [diff] [review]
Added 'Copy Email Address', 'Copy Phone Number' and 'Copy Image Location' to the context menu

This looks good.  Thanks again!

We should probably file a follow-up bug to hide commands like "bookmark link" and "share link" for mailto: and tel: URIs (along with any other commands that don't make sense for some types of links).  Shyam, is this something you'd be interested in working on?
Attachment #560682 - Flags: review?(mbrubeck) → review+
Flags: in-litmus?(aaron.train)
Yeah Matt, I would be interested in working on it.
https://hg.mozilla.org/mozilla-central/rev/1b5705431f5a
Status: ASSIGNED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → Firefox 9
Mozilla/5.0 (Android; Linux armv7l; rv:9.0a1) Gecko/20110920 Firefox/9.0a1 Fennec/9.0a1

https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29813
https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29814
https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29815
Status: RESOLVED → VERIFIED
Flags: in-litmus?(aaron.train) → in-litmus+
All menu options added by this bug have regressed as of the NativeUI builds.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: