From 8398923bb753cb900d0366ff7a511eebd3acd16b Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Wed, 24 Apr 2013 22:29:39 -0700 Subject: [PATCH] Bug 662008 - Handle document title changes across processes (r=felipe) --- browser/base/content/tabbrowser.xml | 39 +++++++++++++++++++++- toolkit/content/browser-child.js | 12 +++++++ toolkit/content/widgets/remote-browser.xml | 22 +++++++++++- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 121db636884e..7dff3366f813 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -39,7 +39,7 @@ - + @@ -293,6 +293,19 @@ + + + + + + + @@ -2685,6 +2698,24 @@ ]]> + + + + + @@ -2754,6 +2788,9 @@ } document.removeEventListener("keypress", this, false); window.removeEventListener("sizemodechange", this, false); + + if (Services.prefs.getBoolPref("browser.tabs.remote")) + messageManager.removeMessageListener("DOMTitleChanged", this); ]]> diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js index 55865bf27567..a67550956669 100644 --- a/toolkit/content/browser-child.js +++ b/toolkit/content/browser-child.js @@ -148,3 +148,15 @@ let WebNavigation = { }; WebNavigation.init(); + +addEventListener("DOMTitleChanged", function (aEvent) { + let document = content.document; + switch (aEvent.type) { + case "DOMTitleChanged": + if (!aEvent.isTrusted || aEvent.target.defaultView != content) + return; + + sendAsyncMessage("DOMTitleChanged", { title: document.title }); + break; + } +}, false); diff --git a/toolkit/content/widgets/remote-browser.xml b/toolkit/content/widgets/remote-browser.xml index 658bc3405dd8..8102c6e41d7c 100644 --- a/toolkit/content/widgets/remote-browser.xml +++ b/toolkit/content/widgets/remote-browser.xml @@ -10,7 +10,7 @@ - + @@ -34,8 +34,15 @@ + null + + + @@ -43,10 +50,23 @@ + + + + +