Open Bug 1711533 Opened 5 years ago Updated 4 years ago

Replace use of getMostRecentBrowserWindow() in mailnews

Categories

(MailNews Core :: General, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: jose, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

Steps to reproduce:

From bug 1710275 comment #11.

getMostRecentWindow("mail:3pane", ...) should be used like in about 50 other places throughout C-C. getMostRecentBrowserWindow() doesn't seem to be the right function, it has "browser" in its name and it calls getMostRecentWindow("navigator:browser", ...) first and then via a conditional compile for Thunderbird calls getMostRecentWindow("mail:3pane", ...) anyway. The conditional code was introduced in bug 1608894 for certificate handling, but it could be removed at some stage.

Depends on: 1710275
Attachment #9222220 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9222220 [details] [diff] [review] 1711533-GetMostRecentBrowserWindow.patch Review of attachment 9222220 [details] [diff] [review]: ----------------------------------------------------------------- I don't know... I tend to think what we have is preferable, and we could change the other exiting usage instead. The name is not 100% ideal but it *is* the window where we have what corresponds to a browser.
Attachment #9222220 - Flags: review?(mkmelin+mozilla) → review-

It's not just the name, the function looks for another window first:
https://searchfox.org/mozilla-central/rev/048146721b3c1a568257afb4325c7a8d94334e2d/xpfe/appshell/nsWindowMediator.cpp#236
It's surprising that what was implemented as a hack for bug 1608894 should now become mainstream usage. For mainstream use, the M-C function would need to change not to try "navigator:browser" first. Until you have a clear concept of how you want to proceed, this should go ahead.

Version: Trunk → Thunderbird 91
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: