Bug 1454440 - Focus the window directly instead of using commandDispatcher in the mac Window menu;r=Gijs
This fixes the Window menu with top-level HTML windows, which don't have `commandDispatcher`
defined on the document.
MozReview-Commit-ID: I7T1LrMf8Ik
--- a/toolkit/content/macWindowMenu.js
+++ b/toolkit/content/macWindowMenu.js
@@ -16,17 +16,17 @@ function macWindowMenuDidShow() {
item.setAttribute("label", win.document.title);
if (win == window) {
item.setAttribute("checked", "true");
}
item.addEventListener("command", () => {
if (win.windowState == window.STATE_MINIMIZED) {
win.restore();
}
- win.document.commandDispatcher.focusedWindow.focus();
+ win.focus();
});
frag.appendChild(item);
}
document.getElementById("windowPopup").appendChild(frag);
}
function macWindowMenuDidHide() {
let sep = document.getElementById("sep-window-list");