Support mailto: urls in tabs.update(), tabs.create() and windows.create()
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr102 wontfix, thunderbird_esr115 wontfix, thunderbird113 wontfix)
People
(Reporter: tdulcet, Assigned: john)
References
Details
(Keywords: regression)
Attachments
(2 files)
This bug was created at the request of John in bug 1716200:
(In reply to John Bieling (:TbSync) from comment #15)
mailto: is broken elsewhere, do not know where. Needs to be fixed in a different bug. Maybe the protocol handler does not like pointing back at itself.
(In reply to John Bieling (:TbSync) from comment #17)
For me, this does not work if executed from the console:
Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(Ci.nsIExternalProtocolService).loadURI(Services.io.newURI("mailto:user@inter.net"));That is not limited to add-ons. There is something broken elsewhere. It does work in Firefox.
This issue is preventing the tabs.update() Mail/Web Extension API from opening mailto: URIs. Note that this API does work in Firefox with mailto: URIs as expected. Based on my remark in bug 1716200 comment 0, this must have worked at some point. Note that clicking a real mailto: link in TB does still open the compose window as expected.
| Reporter | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
not supernova specific, correct?
| Assignee | ||
Comment 2•2 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #1)
not supernova specific, correct?
No, the command
Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(Ci.nsIExternalProtocolService).loadURI(Services.io.newURI("mailto:user@inter.net"));
is broken in 102 as well.
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 3•2 years ago
|
||
Note to myself: https://searchfox.org/comm-central/source/mozilla/browser/base/content/nsContextMenu.js#429-442
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
| Assignee | ||
Comment 5•2 years ago
|
||
The mentioned function call has not worked for Thunderbird for a long time. I went back till TB78. I am not sure it ever worked.
So the fix here will be to manually handle mailto links in the following function calls:
tabs.create({url:"mailto:user@inter.net"})tabs.update(tabId, {url:"mailto:user@inter.net"})windows.create({type: "popup", {url:"mailto:user@inter.net"})
We now have to decide what we want to do.
tabs.update()needs to work.tabs.create()should not be used to create a compose window.- I am unsure about
windows.create(), we have the compose API to explicitly create a new compose window.
What do you think? Can you try this try-build and check if it works for you?
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=27520ea776289858aecb662413fe23488d950347
| Assignee | ||
Updated•2 years ago
|
| Reporter | ||
Comment 6•2 years ago
|
||
What do you think?
Thanks John for fixing this.
I would argue to keep the patch as is and support all three APIs, which would provide full Firefox compatibility. However, my add-on would only need the first two specifically.
| Assignee | ||
Comment 7•2 years ago
|
||
IIRC, you said you need mailto url support in tabs.create() to open multiple compose windows. Is that correct?
I checked Firefox behavior and tabs.create() will open an empty tab and then leave the tab open in addition to the opened external application. Is that really a UX you want to use? Why not use tabs.update() multiple times, which does not open an empty tab?
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
| Reporter | ||
Comment 8•2 years ago
|
||
IIRC, you said you need mailto url support in
tabs.create()to open multiple compose windows. Is that correct?
Yes, my add-on uses tabs.create() to open multiple arbitrary URIs, which includes mailto: URIs.
I checked Firefox behavior and
tabs.create()will open an empty tab and then leave the tab open in addition to the opened external application. Is that really a UX you want to use? Why not use tabs.update() multiple times, which does not open an empty tab?
Yeah, I fully agree that this is not great UX. Using tabs.update() may work now in Thunderbird with mailto: URIs, but unfortunately it does not work in Firefox and it does not work in Thunderbird with arbitrary URIs (tel:, sms:, etc.), as the application picker dialogs will overwrite each other, so only the last URI will open.
| Assignee | ||
Comment 9•2 years ago
|
||
I updated the patch to fully follow Firefox.
Updated•2 years ago
|
| Assignee | ||
Comment 10•2 years ago
|
||
Depends on D199077
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Pushed by solange@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/8f81ee596214
Support mailto: urls in tabs.update(), tabs.create() and windows.create(). r=#thunderbird-reviewers
https://hg.mozilla.org/comm-central/rev/b2f9ee2658e0
Rework tabs.update() and tabs.reload() tests and add missing tests for composer, before adding new tests for tabs.create(). r=#thunderbird-reviewers
| Reporter | ||
Comment 12•1 year ago
|
||
I updated the patch to fully follow Firefox.
Thanks again John for fixing this! I just tested it in Thunderbird Daily and can confirm that it now works as expected.
As you suggested, I did update my local copy of the extension to use tabs.update() with mailto: URIs in Thunderbird, which does provide a much better UX. This will be a great improvement for the Thunderbird 128 update of the add-on and will allow me to implement other functionally related to e-mail addresses and mailto URIs.
(While testing this, I noticed that Thunderbird mangles some obscure e-mail addresses formats containing whitespace characters. At first I though it was related to using a mailto: URI, but the issue also happens with the compose.beginNew() API. I just filed Bug 1879762 about the issue, but I was not sure which Thunderbird component to put it in.)
| Assignee | ||
Updated•1 year ago
|
Description
•