Closed
Bug 439292
Opened 17 years ago
Closed 16 years ago
Context menu for mailto: links should include commands like "Open in new tab" (when handled by a web app)
Categories
(Firefox :: General, enhancement)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 3.1b1
People
(Reporter: Natch, Assigned: Natch)
References
()
Details
Attachments
(1 file, 3 obsolete files)
1.43 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
The context menu for regular links includes an option to open in a new tab/window, since mailto is now handled in the browser, there should be a similar option.
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Assignee | ||
Comment 1•16 years ago
|
||
Here's a patch that's tested and works.
Attachment #335590 -
Flags: review?
Assignee | ||
Updated•16 years ago
|
Attachment #335590 -
Flags: review? → review?(gavin.sharp)
Comment 2•16 years ago
|
||
Comment on attachment 335590 [details] [diff] [review]
Patch for nsContextmenu
>diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
> initOpenItems: function CM_initOpenItems() {
>+ var extProtocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
>+ .getService(Components.interfaces.nsIExternalProtocolService);
>+ var isMailtoInternal;
>+ if (extProtocolSvc) {
This null check is unnecessary, getService will either return an object or throw. You can just call getProtocolHandlerInfo directly on the result of getService and assign directly to mailtoHandler (removing the extProtocolSvc variable entirely). You can also use the Cc/Ci shortcuts here as with other getService calls in this file.
>+ var mailtoHandler = extProtocolSvc.getProtocolHandlerInfo("mailto");
>+ isMailtoInternal = (mailtoHandler.preferredAction == 2 &&
Can use Ci.nsIHandlerInfo.useHelperApp here, rather than "2".
>+ (mailtoHandler.preferredApplicationHandler instanceof Ci.nsIWebHandlerApp));
>+ }
Otherwise this looks good, thanks for the patch! Attach a patch addressing those comments and I'll r+.
Updated•16 years ago
|
Severity: trivial → enhancement
Status: UNCONFIRMED → NEW
Component: Tabbed Browser → General
Ever confirmed: true
QA Contact: tabbed.browser → general
Assignee | ||
Comment 3•16 years ago
|
||
Attachment #335590 -
Attachment is obsolete: true
Attachment #335631 -
Flags: review?(gavin.sharp)
Attachment #335590 -
Flags: review?(gavin.sharp)
Comment 4•16 years ago
|
||
Comment on attachment 335631 [details] [diff] [review]
Addresses comment 2
Actually, I noticed one last thing: you can avoid doing all that work to retrieve isMailtoInternal if this.onMailtoLink is false. I'll fix that and check it in.
Attachment #335631 -
Flags: review?(gavin.sharp) → review+
Comment 5•16 years ago
|
||
Attachment #335631 -
Attachment is obsolete: true
Updated•16 years ago
|
Assignee: nobody → highmind63
Comment 6•16 years ago
|
||
Hmm, with this latest patch I still get the "Open in new tab" options if I select "Always ask".
Comment 7•16 years ago
|
||
A check for !alwaysAskBeforeHandling fixes that.
Attachment #335637 -
Attachment is obsolete: true
Comment 8•16 years ago
|
||
Fixed for Firefox 3.1
http://hg.mozilla.org/mozilla-central/index.cgi/rev/5c132b2d3848
Thanks again for the patch!
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.1b1
Assignee | ||
Comment 9•16 years ago
|
||
(In reply to comment #7)
> Created an attachment (id=335639) [details]
> updated updated patch
>
> A check for !alwaysAskBeforeHandling fixes that.
That shouldn't be necessary as preferredAction should not be == useHelperApp. It worked in my patch. Anyhow... thanks for the help.
Comment 10•16 years ago
|
||
(In reply to comment #9)
> That shouldn't be necessary as preferredAction should not be == useHelperApp.
> It worked in my patch. Anyhow... thanks for the help.
preferredAction isn't updated when askBeforeHandling is set, so it is needed (at least for me, on Mac). You need to switch to a web handler (so that preferredAction gets set), and then switch to "Always ask" for it to be a problem, though, so that might explain why you didn't see that problem in testing.
Updated•16 years ago
|
Summary: Now that mailto links are handled by a web-app there should be an option to open in a new tab → Context menu for mailto: links should include commands like "Open in new tab" (when handled by a web app)
You need to log in
before you can comment on or make changes to this bug.
Description
•