From 6f6843ad2b78c4d9709ed147dfebb20459405cc8 Mon Sep 17 00:00:00 2001 From: "loadrunner%betak.net" Date: Sat, 29 Jul 2006 05:37:27 +0000 Subject: [PATCH] bug 79735, User-overridden browser charset does not propagate into the composer window, r=cmanske, sr=blizzard git-svn-id: svn://10.0.0.236/trunk@205451 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/common/utilityOverlay.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mozilla/suite/common/utilityOverlay.js b/mozilla/suite/common/utilityOverlay.js index bddf5884229..99100394ee9 100644 --- a/mozilla/suite/common/utilityOverlay.js +++ b/mozilla/suite/common/utilityOverlay.js @@ -329,6 +329,15 @@ function editPage(url, launchWindow, delay) } } + // if the current window is a browser window, then extract the current charset menu setting from the current + // document and use it to initialize the new composer window... + + var wintype = document.firstChild.getAttribute('windowtype'); + var charsetArg; + + if (launchWindow && (wintype == "navigator:browser")) + charsetArg = "charset=" + launchWindow._content.document.characterSet; + var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); if (!windowManager) return; var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); @@ -352,9 +361,9 @@ function editPage(url, launchWindow, delay) // Create new Composer window if (delay) - launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); + launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url, charsetArg); else - launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url); + launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } // function that extracts the filename from a url