Skip to content

Commit

Permalink
Bug 1608894 - use getMostRecentWindow to find mainwindow, and hook th…
Browse files Browse the repository at this point in the history
…at up for Thunderbird too. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D76019
  • Loading branch information
mkmelin committed May 22, 2020
1 parent 4010414 commit 893c2ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion security/manager/pki/resources/content/pippki.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function viewCertHelper(parent, cert, openingOption = "tab") {
}

if (Services.prefs.getBoolPref("security.aboutcertificate.enabled")) {
let win = Services.wm.getMostRecentWindow("navigator:browser");
let win = Services.wm.getMostRecentBrowserWindow();
let results = await asyncDetermineUsages(cert);
let chain = getBestChain(results);
if (!chain) {
Expand Down
2 changes: 1 addition & 1 deletion xpfe/appshell/nsIWindowMediator.idl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ interface nsIWindowMediator: nsISupports
mozIDOMWindowProxy getMostRecentWindow(in wstring aWindowType);

/** This is a shortcut for getMostRecentWindow('navigator:browser'), but
* it also tries 'navigator:geckoview' if that fails.
* if that fails it also tries 'navigator:geckoview' and 'mail:3pane'.
*
* @return the topmost browser window
*/
Expand Down
7 changes: 7 additions & 0 deletions xpfe/appshell/nsWindowMediator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ nsWindowMediator::GetMostRecentBrowserWindow(mozIDOMWindowProxy** outWindow) {
}
#endif

#ifdef MOZ_THUNDERBIRD
if (!*outWindow) {
rv = GetMostRecentWindow(u"mail:3pane", outWindow);
NS_ENSURE_SUCCESS(rv, rv);
}
#endif

return NS_OK;
}

Expand Down

0 comments on commit 893c2ec

Please sign in to comment.