Enforce full startup of Thunderbird, when message composer is opened via mailto: link, to ensure sane environment (and make add-ons work again)
Categories
(Thunderbird :: Add-Ons: General, defect)
Tracking
(thunderbird_esr102 wontfix, thunderbird_esr115 fixed, thunderbird121 wontfix, thunderbird122 wontfix)
People
(Reporter: lubomir.bucek, Assigned: TbSync)
References
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr115+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Steps to reproduce:
When I start email client Thunderbird from any other program via command:
ShellExecute(GetDesktopWindow()->m_hWnd, "open", "mailto:anymail@anymail.com", NULL, NULL, SW_SHOWNORMAL);
Thunderbird Mail Window opens properly, but QuickText plugin is not accessible.
QuickText works only in a case, when the full main Thunderbird window is opened and running before ShellExecute(..."mailto:anymail@anymail.com" ...) is called.
This bug in Thunderbird is new, older versions worked properly.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
I may have an idea, how to fix this. Will try to fix it for 115.
Assignee | ||
Comment 2•2 years ago
|
||
The reason is that add-on startup has been delayed until after the app is fully loaded.
The add-on startup notification is never send, when a composer is opened directly in composer-only mode. Would it be ok to start the main app + the composer, when a mailto: link is passed into thunderbird? What is the gain of not fully loading the app? For example would it not be beneficial to be able to check the send folder after the message has been sent?
I could imagine that other services could be missing as well in the composer-only mode.
Comment 3•2 years ago
•
|
||
Good timing. I just landed a change that does exactly that. https://hg.mozilla.org/comm-central/rev/e0539a23f82b7e2c72e0475392ff7681302be5c7#l2.374
Assignee | ||
Comment 4•2 years ago
|
||
The mailto
case seems untouched and is still:
case "mailto": {
let xuri = cmdLine.resolveURI("mailto:" + remoteParams[0]);
openURI(xuri);
break;
}
I would have changed it to:
case "mailto": {
let xuri = cmdLine.resolveURI("mailto:" + remoteParams[0]);
getOrOpen3PaneWindow().then(() => openURI(xuri);
break;
}
or something along those lines. Would that be ok?
Comment 5•2 years ago
|
||
Ah, yes I think that would make sense.
While theoretically you can compose without the 3pane... I'm not sure why you would do that.
Reporter | ||
Comment 6•2 years ago
|
||
When I started this Bug 1800423, I supposed Mozila repair Thuderbird.
Reporter | ||
Comment 7•2 years ago
|
||
When I started this Bug 1800423, I supposed Mozila repair Thuderbird.
Because html pages with <a href="Mailto:aaa@bbb.cc?subject=AAA">bla-bla-bla</a>
Reporter | ||
Comment 8•2 years ago
|
||
When I started this Bug 1800423, I supposed Mozila repair Thuderbird.
Because html pages with <a href="Mailto:aaa@bbb.cc?subject=AAA">bla-bla-bla</a>
makes the sam problem: Thunnderbird is opening new email without Quicktext.
Assignee | ||
Comment 9•2 years ago
|
||
Magnus, you are correct. With https://hg.mozilla.org/comm-central/rev/e0539a23f82b7e2c72e0475392ff7681302be5c7#l2.374 landed, I can already execute
thunderbird mailto:user@something.net
and the composer is opened after an application window has been created. Before closing this as fixed. I want to make sure we covered all cases.
Wenn I execute the above statement, we skip the remoteCommand
section:
https://searchfox.org/comm-central/rev/1045fa69e30893e86041a615f0bdfd4bc78bfa21/mail/components/MessengerContentHandler.jsm#239-302
We also skip the chromeParam
section:
https://searchfox.org/comm-central/rev/1045fa69e30893e86041a615f0bdfd4bc78bfa21/mail/components/MessengerContentHandler.jsm#304-327
We enter the uri
section:
https://searchfox.org/comm-central/rev/1045fa69e30893e86041a615f0bdfd4bc78bfa21/mail/components/MessengerContentHandler.jsm#413-644
In the uri
section we fall through to the last else
statement which now calls getOrOpen3PaneWindow()
. Because the try { ... }
fails, we call openURI(cmdLine.resolveURI(uri));
in the catch(e) { ... }
block.
That means we do not at all enter the mailto
case in the remoteCommand
section:
https://searchfox.org/comm-central/rev/1045fa69e30893e86041a615f0bdfd4bc78bfa21/mail/components/MessengerContentHandler.jsm#251-255
- What is the
remoteCommand
section for? How can I trigger that? - The comment here may be misleading. Should we update it to
// This may be a regular filename. Attempt to use it to create a new empty message with attachment.
// Otherwise attempt to interpret it as a uri and try to open it (for example a mailto: uri)
?
Assignee | ||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Without investigating it, perhaps it's involved in the way to compose where you don't have mailto:. but -compose
(For more privileges, like to specify attachments). See http://kb.mozillazine.org/Command_line_arguments_-_Thunderbird
Updating the comment sounds good.
Assignee | ||
Comment 11•2 years ago
|
||
Thanks Magnus. I tried to use -compose
, that triggers this cpp code:
https://searchfox.org/comm-central/rev/f01fefe31f97220234524e77e6e6c637f82cbe9c/mailnews/compose/src/nsMsgComposeService.cpp#1373-1377
That IS another case where the compose window is opened stand alone and which suffers from the same issue (add-on startup not announced).
-
cpp code is not really my area, could you point me to code which I could use to start up the main window before the compose window is opened?
-
Or should we think about unifying entry points and move that out of the cpp file and handle it in
MessengerContentHandler.jsm
as well (it does end up there, but becausecmdLine.preventDefault
is set, nothing is done)? -
Do you have another idea, what the
remoteCommand
section inMessengerContentHandler.jsm
is for and how can I trigger that?
Comment 12•2 years ago
|
||
Starting and waiting for the window in cpp would be difficult at best. It would indeed be much nicer if everything went through MessengerContentHandler.jsm
Sorry I don't know anything else about remoteCommand. Very possibly just old cruft that nobody dared to touch.
Reporter | ||
Comment 13•2 years ago
|
||
In C++ msvc (MFC):
Reporter | ||
Comment 14•2 years ago
|
||
In C++ msvc (MFC):
where m_Email is member CString
void CPrehledOp::OnBnClickedButtonEmail()
{
UpdateData(TRUE);
// start ThuinderBird
char strPrgFiles86[_MAX_DIR];
if(SHGetSpecialFolderPathA(this->m_hWnd, strPrgFiles86, CSIDL_PROGRAM_FILESX86, FALSE))
{
STARTUPINFO s_info;
PROCESS_INFORMATION p_info;
memset(&s_info, 0, sizeof(STARTUPINFO));
memset(&p_info, 0, sizeof(PROCESS_INFORMATION));
s_info.cb = sizeof(STARTUPINFO);
//s_info.wShowWindow = SW_MINIMIZE; //DOES NOT WORK
char strCurrentDirectory[_MAX_PATH];
sprintf_s(strCurrentDirectory, "%s\\Mozilla Thunderbird", strPrgFiles86);
char strCommandLine[_MAX_PATH];
sprintf_s(strCommandLine, "%s\\thunderbird.exe", strCurrentDirectory);
::CreateProcess(NULL, strCommandLine, NULL, NULL, 0, NORMAL_PRIORITY_CLASS, NULL, strCurrentDirectory, &s_info, &p_info);
}
// mailto
CString strMailTo = "mailto:";
strMailTo += m_Email;
ShellExecute(GetDesktopWindow()->m_hWnd, "open", strMailTo, NULL, NULL, SW_SHOWNORMAL);
}
Of course it does'nt solve a case, when you meet <a href="Mailto:aaa@bbb.cc?subject=AAA">bla-bla-bla</a> in browser...
Comment 15•2 years ago
|
||
So, just to clarify - is this bug about making sure that add-ons are started up when TB is opened via a mailto link?
If the answer is Yes, can the title be rephrased accordingly?
Assignee | ||
Comment 16•2 years ago
|
||
The fix for the reported issue is to enforce loading the full app before opening the message compose window. Will change the subject.
Assignee | ||
Updated•2 years ago
|
Comment 17•1 year ago
|
||
Would be nice if this could be fixed. A lot of add-ons hook into the composer window and i'm sure, some people are womderimng, why their installed add-ons are not working if the use a mailto: link. At least one of my customers does.
Assignee | ||
Comment 18•1 year ago
|
||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 19•1 year ago
|
||
Pushed by micah@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/49efee0f33a1
Enforce full app startup for mailto: and file: url cmdLine parameters. r=mkmelin
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 20•1 year ago
|
||
Comment on attachment 9365388 [details]
Bug 1800423 - Enforce full app startup for mailto: and file: url cmdLine parameters. r=mkmelin
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Startups using mailto: and file: urls via command line will not start the full app, and add-ons will not work
Testing completed (on c-c, etc.): full beta cycle
Risk to taking this patch (and alternatives if risky):
If this is uplifted, Bug 1866915 has to be uplifted as well.
Comment 21•1 year ago
|
||
Comment on attachment 9365388 [details]
Bug 1800423 - Enforce full app startup for mailto: and file: url cmdLine parameters. r=mkmelin
[Triage Comment]
Approved for esr115
Comment 22•1 year ago
|
||
bugherder uplift |
Thunderbird 115.7.0:
https://hg.mozilla.org/releases/comm-esr115/rev/c873be706336
Description
•