Bug 877199 - Browser console's window title temporarily says 'Web Console' before changing to 'Browser console'; r=robcee

This commit is contained in:
Mihai Sucan 2013-05-30 18:08:14 +03:00
Родитель 61505342f9
Коммит 37d0e77cbe
1 изменённых файлов: 14 добавлений и 11 удалений

Просмотреть файл

@ -540,23 +540,21 @@ ViewHelpers.create({ constructor: BrowserConsole, proto: WebConsole.prototype },
}
let window = this.iframeWindow;
// Make sure that the closing of the Browser Console window destroys this
// instance.
let onClose = () => {
window.removeEventListener("unload", onClose);
this.destroy();
};
window.addEventListener("unload", onClose);
this._bc_init = this.$init().then((aReason) => {
this._telemetry.toolOpened("browserconsole");
let title = this.ui.rootElement.getAttribute("browserConsoleTitle");
this.ui.rootElement.setAttribute("title", title);
// Make sure Ctrl-W closes the Browser Console window.
window.document.getElementById("cmd_close").removeAttribute("disabled");
let cmd_close = this.ui.document.getElementById("cmd_close");
cmd_close.removeAttribute("disabled");
return aReason;
});
this._telemetry.toolOpened("browserconsole");
this._bc_init = this.$init();
return this._bc_init;
},
@ -700,8 +698,13 @@ var HeadsUpDisplayUICommands = {
let win = Services.ww.openWindow(null, devtools.Tools.webConsole.url, "_blank",
BROWSER_CONSOLE_WINDOW_FEATURES, null);
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad);
win.addEventListener("DOMContentLoaded", function onLoad() {
win.removeEventListener("DOMContentLoaded", onLoad);
// Set the correct Browser Console title.
let root = win.document.documentElement;
root.setAttribute("title", root.getAttribute("browserConsoleTitle"));
deferred.resolve(win);
});