From b775400b9ccad077f1ebbd088fb121e55befa57f Mon Sep 17 00:00:00 2001 From: "caillon%returnzero.com" Date: Wed, 11 Sep 2002 11:45:38 +0000 Subject: [PATCH] 77315 - Make send page grab the correct document title. r=sicking sr=bzbarsky --- editor/ui/composer/content/ComposerCommands.js | 11 ++++++----- .../base/resources/content/mailNavigatorOverlay.xul | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/editor/ui/composer/content/ComposerCommands.js b/editor/ui/composer/content/ComposerCommands.js index 3d1cc65d373b..62560648916b 100644 --- a/editor/ui/composer/content/ComposerCommands.js +++ b/editor/ui/composer/content/ComposerCommands.js @@ -583,7 +583,7 @@ function GetSuggestedFileName(aDocumentURLString, aMIMEType, aHTMLDoc) } // check if there is a title we can use - var title = aHTMLDoc.title; + var title = Components.lookupMethod(aHTMLDoc, 'title').call(aHTMLDoc); if (title.length > 0) // we have a title; let's see if it's usable { // clean up the title to make it a usable filename @@ -686,7 +686,7 @@ function PromptAndSetTitleIfNone(aHTMLDoc) { if (!aHTMLDoc) throw NS_ERROR_NULL_POINTER; - var title = aHTMLDoc.title; + var title = Components.lookupMethod(aHTMLDoc, 'title').call(aHTMLDoc); if (title.length > 0) // we have a title; no need to prompt! return true; @@ -1939,16 +1939,17 @@ var nsSendPageCommand = doCommand: function(aCommand) { - // Don't continue if user canceled during prompt for saving + // Don't continue if user canceled during prompt for saving // DocumentHasBeenSaved will test if we have a URL and suppress "Don't Save" button if not if (!CheckAndSaveDocument("cmd_editSendPage", DocumentHasBeenSaved())) return; // Check if we saved again just in case? - if (DocumentHasBeenSaved()) + if (DocumentHasBeenSaved()) { // Launch Messenger Composer window with current page as contents - var pageTitle = window.editorShell.editorDocument.title; + var pageDoc = window.editorShell.editorDocument; + var pageTitle = Components.lookupMethod(pageDoc, 'title').call(pageDoc); var pageUrl = GetDocumentUrl(); try { diff --git a/mailnews/base/resources/content/mailNavigatorOverlay.xul b/mailnews/base/resources/content/mailNavigatorOverlay.xul index 9f4d5cf3530a..4bba56e4476a 100644 --- a/mailnews/base/resources/content/mailNavigatorOverlay.xul +++ b/mailnews/base/resources/content/mailNavigatorOverlay.xul @@ -86,7 +86,7 @@ aDocument = window._content.document; var pageUrl = aDocument.URL; - var pageTitle = aDocument.title; + var pageTitle = Components.lookupMethod(aDocument, 'title').call(aDocument); try { openComposeWindow(pageUrl, pageTitle, 1); @@ -119,7 +119,9 @@ - +