Bug 787612 - Port Bug 596234 "Body of RSS feeds won't print or print preview" to SeaMonkey". r=frg a=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 15 Sep 2019 13:03:21 +0200
changeset 32309 6078db5cb2520750c3e369e74719597aa837c7c9
parent 32308 c63461e34b77cc0a804beb4055070bbd0308f16c
child 32310 da2c74f5383834a99773d54b0246e1b8c3972583
push id218
push userfrgrahl@gmx.net
push dateSun, 15 Sep 2019 11:06:46 +0000
treeherdercomm-esr60@da2c74f53838 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs787612, 596234
Bug 787612 - Port Bug 596234 "Body of RSS feeds won't print or print preview" to SeaMonkey". r=frg a=frg
suite/mailnews/content/folderDisplay.js
suite/mailnews/content/mailCommands.js
suite/mailnews/content/mailWindowOverlay.js
suite/mailnews/content/mailWindowOverlay.xul
suite/mailnews/content/msgHdrViewOverlay.js
suite/themes/classic/messenger/messageBody.css
suite/themes/modern/messenger/messageBody.css
--- a/suite/mailnews/content/folderDisplay.js
+++ b/suite/mailnews/content/folderDisplay.js
@@ -22,19 +22,17 @@ var gFolderDisplay =
   {
     if (!this.selectedIndices.length)
       return null;
     return gDBView.URIForFirstSelectedMessage;
   },
 
   get selectedMessageIsFeed()
   {
-    var message = this.selectedMessage;
-    return message && message.folder &&
-           message.folder.server.type == "rss";
+    return FeedMessageHandler.isFeedMessage(this.selectedMessage);
   },
 
   get selectedMessageIsImap()
   {
     var message = this.selectedMessage;
     return message && message.folder &&
            (message.folder.flags & this.nsMsgFolderFlags.ImapBox) != 0;
   },
--- a/suite/mailnews/content/mailCommands.js
+++ b/suite/mailnews/content/mailCommands.js
@@ -222,17 +222,17 @@ function ComposeMessage(type, format, fo
       if (messageArray.length > 8)
         messageArray.length = 8;
 
       for (var i = 0; i < messageArray.length; ++i)
       {
         var messageUri = messageArray[i];
         hdr = messenger.msgHdrFromURI(messageUri);
         identity = GetIdentityForHeader(hdr, type);
-        if (hdr.folder && hdr.folder.server.type == "rss")
+        if (FeedMessageHandler.isFeedMessage(hdr))
           openComposeWindowForRSSArticle(null, hdr, messageUri, type,
                                          format, identity, msgWindow);
         else
           msgComposeService.OpenComposeWindow(null, hdr, messageUri, type,
                                               format, identity, msgWindow);
       }
   }
 }
--- a/suite/mailnews/content/mailWindowOverlay.js
+++ b/suite/mailnews/content/mailWindowOverlay.js
@@ -48,17 +48,17 @@ if (gTimelineEnabled) {
     }
   }
   catch (ex)
   {
     gTimelineEnabled = false;
   }
 }
 
-var disallow_classes_no_html = 1; /* the user preference,
+var gDisallow_classes_no_html = 1; /* the user preference,
      if HTML is not allowed. I assume, that the user could have set this to a
      value > 1 in his prefs.js or user.js, but that the value will not
      change during runtime other than through the MsgBody*() functions below.*/
 
 // Disable the File | New | Account... menu item if the account preference is locked.
 // Two other affected areas are the account central and the account manager dialogs.
 function menu_new_init()
 {
@@ -154,39 +154,33 @@ function view_init()
   if (threads_menuitem)
     threads_menuitem.setAttribute("disabled", gAccountCentralLoaded);
 
   var charset_menuitem = document.getElementById("charsetMenu");
   if (charset_menuitem)
     charset_menuitem.setAttribute("disabled", !gMessageDisplay.displayedMessage);
 
   // Initialize the Message Body menuitem
-  var isFeed = gFolderDisplay.selectedMessageIsFeed;
-  document.getElementById('viewBodyMenu').hidden = isFeed;
+  let isFeed = gFolderDisplay &&
+               ((gFolderDisplay.displayedFolder &&
+                 gFolderDisplay.displayedFolder.server.type == "rss") ||
+                gFolderDisplay.selectedMessageIsFeed);
+  document.getElementById("viewBodyMenu").hidden = isFeed;
 
   // Initialize the Show Feed Summary menu
-  var viewFeedSummary = document.getElementById('viewFeedSummary');
-  var winType = document.documentElement.getAttribute('windowtype');
-  if (winType != "mail:3pane")
-    viewFeedSummary.hidden = !gShowFeedSummary;
-  else
-    viewFeedSummary.hidden = !isFeed;
-
-  var viewRssMenuItemIds = ["bodyFeedGlobalWebPage",
+  let viewFeedSummary = document.getElementById("viewFeedSummary");
+  viewFeedSummary.hidden = !isFeed;
+
+  let viewRssMenuItemIds = ["bodyFeedGlobalWebPage",
                             "bodyFeedGlobalSummary",
                             "bodyFeedPerFolderPref"];
-  var checked = Services.prefs.getIntPref("rss.show.summary");
-  document.getElementById(viewRssMenuItemIds[checked])
-          .setAttribute("checked", true);
-
-  if (winType != "mail:3pane") {
-    document.getElementById("viewFeedSummarySeparator").hidden = true;
-    document.getElementById("bodyFeedGlobalWebPage").hidden = true;
-    document.getElementById("bodyFeedGlobalSummary").hidden = true;
-    document.getElementById("bodyFeedPerFolderPref").hidden = true;
+  let checked = FeedMessageHandler.onSelectPref;
+  for (let [index, id] of viewRssMenuItemIds.entries()) {
+    document.getElementById(id)
+            .setAttribute("checked", index == checked);
   }
 
   // Initialize the Display Attachments Inline menu.
   var viewAttachmentInline = Services.prefs.getBoolPref("mail.inline_attachments");
   document.getElementById("viewAttachmentsInlineMenuitem").setAttribute("checked", viewAttachmentInline ? "true" : "false");
 
   document.commandDispatcher.updateCommands('create-menu-view');
 }
@@ -369,20 +363,21 @@ function InitMessageMenu()
       tagMenu.setAttribute("disabled", !aMessage);
 
   // Initialize the Open Message menuitem
   var winType = document.documentElement.getAttribute('windowtype');
   if (winType == "mail:3pane")
     document.getElementById('openMessageWindowMenuitem').hidden = isFeed;
 
   // Initialize the Open Feed Message handler menu
-  var index = GetFeedOpenHandler();
+  let index = FeedMessageHandler.onOpenPref;
   document.getElementById("menu_openFeedMessage")
           .childNodes[index].setAttribute("checked", true);
-  var openRssMenu = document.getElementById("openFeedMessage");
+
+  let openRssMenu = document.getElementById("openFeedMessage");
   openRssMenu.hidden = !isFeed;
   if (winType != "mail:3pane")
     openRssMenu.hidden = true;
 
   // Disable the Mark menu when we're not in a folder.
   var markMenu = document.getElementById("markMenu");
   if(markMenu)
       markMenu.setAttribute("disabled", !msgFolder);
@@ -416,56 +411,43 @@ function InitViewHeadersMenu()
 
   var menuitem = document.getElementById(id);
   if (menuitem)
     menuitem.setAttribute("checked", "true");
 }
 
 function InitViewBodyMenu()
 {
-  var html_as = 0;
-  var prefer_plaintext = false;
-  var disallow_classes = 0;
-  var isFeed = gFolderDisplay.selectedMessageIsFeed;
+  // Separate render prefs not implemented for feeds, bug 458606.  Show the
+  // checked item for feeds as for the regular pref.
+  //  let html_as = Services.prefs.getIntPref("rss.display.html_as");
+  //  let prefer_plaintext = Services.prefs.getBoolPref("rss.display.prefer_plaintext");
+  //  let disallow_classes = Services.prefs.getIntPref("rss.display.disallow_mime_handlers");
+
+  let html_as = Services.prefs.getIntPref("mailnews.display.html_as");
+  let prefer_plaintext = Services.prefs.getBoolPref("mailnews.display.prefer_plaintext");
+  let disallow_classes = Services.prefs.getIntPref("mailnews.display.disallow_mime_handlers");
+  let isFeed = gFolderDisplay.selectedMessageIsFeed;
   const defaultIDs = ["bodyAllowHTML",
                       "bodySanitized",
                       "bodyAsPlaintext",
                       "bodyAllParts"];
   const rssIDs = ["bodyFeedSummaryAllowHTML",
                   "bodyFeedSummarySanitized",
                   "bodyFeedSummaryAsPlaintext"];
-  var menuIDs = isFeed ? rssIDs : defaultIDs;
-  try
-  {
-    // Get prefs
-    if (isFeed) {
-      prefer_plaintext = Services.prefs.getBoolPref("rss.display.prefer_plaintext");
-      html_as = Services.prefs.getIntPref("rss.display.html_as");
-      disallow_classes = Services.prefs.getIntPref("rss.display.disallow_mime_handlers");
-    }
-    else {
-      prefer_plaintext = Services.prefs.getBoolPref("mailnews.display.prefer_plaintext");
-      html_as = Services.prefs.getIntPref("mailnews.display.html_as");
-      disallow_classes =
-                    Services.prefs.getIntPref("mailnews.display.disallow_mime_handlers");
-    }
-
-    if (disallow_classes > 0)
-      disallow_classes_no_html = disallow_classes;
-    // else disallow_classes_no_html keeps its inital value (see top)
-  }
-  catch (ex)
-  {
-    dump("failed to get the body plaintext vs. HTML prefs\n");
-  }
-
-  var AllowHTML_menuitem = document.getElementById(menuIDs[0]);
-  var Sanitized_menuitem = document.getElementById(menuIDs[1]);
-  var AsPlaintext_menuitem = document.getElementById(menuIDs[2]);
-  var AllBodyParts_menuitem;
+  let menuIDs = isFeed ? rssIDs : defaultIDs;
+
+  if (disallow_classes > 0)
+    gDisallow_classes_no_html = disallow_classes;
+  // else gDisallow_classes_no_html keeps its inital value (see top)
+
+  let AllowHTML_menuitem = document.getElementById(menuIDs[0]);
+  let Sanitized_menuitem = document.getElementById(menuIDs[1]);
+  let AsPlaintext_menuitem = document.getElementById(menuIDs[2]);
+  let AllBodyParts_menuitem;
   if (!isFeed) {
     AllBodyParts_menuitem = document.getElementById(menuIDs[3]);
     AllBodyParts_menuitem.hidden =
       !Services.prefs.getBoolPref("mailnews.display.show_all_body_parts_menu");
   }
 
   if (!prefer_plaintext && !html_as && !disallow_classes &&
       AllowHTML_menuitem)
@@ -477,20 +459,20 @@ function InitViewBodyMenu()
       AsPlaintext_menuitem)
     AsPlaintext_menuitem.setAttribute("checked", true);
   else if (!prefer_plaintext && html_as == 4 && !disallow_classes &&
       AllBodyParts_menuitem)
     AllBodyParts_menuitem.setAttribute("checked", true);
   // else (the user edited prefs/user.js) check none of the radio menu items
 
   if (isFeed) {
-    AllowHTML_menuitem.hidden = !gShowFeedSummary;
-    Sanitized_menuitem.hidden = !gShowFeedSummary;
-    AsPlaintext_menuitem.hidden = !gShowFeedSummary;
-    document.getElementById("viewFeedSummarySeparator").hidden = !gShowFeedSummary;
+    AllowHTML_menuitem.hidden = !FeedMessageHandler.gShowSummary;
+    Sanitized_menuitem.hidden = !FeedMessageHandler.gShowSummary;
+    AsPlaintext_menuitem.hidden = !FeedMessageHandler.gShowSummary;
+    document.getElementById("viewFeedSummarySeparator").hidden = !FeedMessageHandler.gShowSummary;
   }
 }
 
 function SetMenuItemLabel(menuItemId, customLabel)
 {
   var menuItem = document.getElementById(menuItemId);
   if (menuItem)
     menuItem.setAttribute('label', customLabel);
@@ -1633,22 +1615,31 @@ function MsgOpenNewWindowForFolder(uri, 
    var mailWindowService = Cc["@mozilla.org/messenger/windowservice;1"].getService(Ci.nsIMessengerWindowService);
    if (mailWindowService)
      mailWindowService.openMessengerWindowWithUri("mail:3pane", uriToOpen, keyToSelect);
   }
 }
 
 function MsgOpenSelectedMessages()
 {
-  // Toggle message body (rss summary) and content-base url in message
-  // pane per pref, otherwise open summary or web page in new window.
-  if (gFolderDisplay.selectedMessageIsFeed && GetFeedOpenHandler() == 2)
-  {
-    FeedSetContentViewToggle();
-    return;
+  // Toggle message body (feed summary) and content-base url in message pane or
+  // load in browser, per pref, otherwise open summary or web page in new window
+  // or tab, per that pref.
+  if (gFolderDisplay.selectedMessageIsFeed) {
+    let msgHdr = gFolderDisplay.selectedMessage;
+    if (document.documentElement.getAttribute("windowtype") == "mail:3pane" &&
+        FeedMessageHandler.onOpenPref == FeedMessageHandler.kOpenToggleInMessagePane) {
+      let showSummary = FeedMessageHandler.shouldShowSummary(msgHdr, true);
+      FeedMessageHandler.setContent(msgHdr, showSummary);
+      return;
+    }
+    if (FeedMessageHandler.onOpenPref == FeedMessageHandler.kOpenLoadInBrowser) {
+      setTimeout(FeedMessageHandler.loadWebPage, 20, msgHdr, {browser:true});
+      return;
+    }
   }
 
   var dbView = GetDBView();
   var indices = GetSelectedIndices(dbView);
   var numMessages = indices.length;
 
   // This is a radio type button pref, currently with only 2 buttons.
   // We need to keep the pref type as 'bool' for backwards compatibility
@@ -1973,70 +1964,54 @@ function MsgBodyAllowHTML()
     return true;
 }
 
 function MsgBodySanitized()
 {
     Services.prefs.setBoolPref("mailnews.display.prefer_plaintext", false);
     Services.prefs.setIntPref("mailnews.display.html_as", 3);
     Services.prefs.setIntPref("mailnews.display.disallow_mime_handlers",
-                           disallow_classes_no_html);
+                              gDisallow_classes_no_html);
     ReloadMessage();
     return true;
 }
 
 function MsgBodyAsPlaintext()
 {
     Services.prefs.setBoolPref("mailnews.display.prefer_plaintext", true);
     Services.prefs.setIntPref("mailnews.display.html_as", 1);
     Services.prefs.setIntPref("mailnews.display.disallow_mime_handlers",
-                           disallow_classes_no_html);
+                              gDisallow_classes_no_html);
     ReloadMessage();
     return true;
 }
 
 function MsgBodyAllParts()
 {
   Services.prefs.setBoolPref("mailnews.display.prefer_plaintext", false);
   Services.prefs.setIntPref("mailnews.display.html_as", 4);
   Services.prefs.setIntPref("mailnews.display.disallow_mime_handlers", 0);
   ReloadMessage();
   return true;
 }
 
 function MsgFeedBodyRenderPrefs(plaintext, html, mime)
 {
-  Services.prefs.setBoolPref("rss.display.prefer_plaintext", plaintext);
-  Services.prefs.setIntPref("rss.display.html_as", html);
-  Services.prefs.setIntPref("rss.display.disallow_mime_handlers", mime);
+  // Separate render prefs not implemented for feeds, bug 458606.
+  //  Services.prefs.setBoolPref("rss.display.prefer_plaintext", plaintext);
+  //  Services.prefs.setIntPref("rss.display.html_as", html);
+  //  Services.prefs.setIntPref("rss.display.disallow_mime_handlers", mime);
+
+  Services.prefs.setBoolPref("mailnews.display.prefer_plaintext", plaintext);
+  Services.prefs.setIntPref("mailnews.display.html_as", html);
+  Services.prefs.setIntPref("mailnews.display.disallow_mime_handlers", mime);
   // Reload only if showing rss summary; menuitem hidden if web page..
   ReloadMessage();
 }
 
-//How to load message with content-base url on enter in threadpane
-function GetFeedOpenHandler()
-{
-  return Services.prefs.getIntPref("rss.show.content-base");
-}
-
-function ChangeFeedOpenHandler(val)
-{
-  Services.prefs.setIntPref("rss.show.content-base", val);
-}
-
-//Current state: load web page if 0, show summary if 1
-var gShowFeedSummary;
-var gShowFeedSummaryToggle = false;
-
-function ChangeFeedShowSummaryPref(val)
-{
-  Services.prefs.setIntPref("rss.show.summary", val);
-  ReloadMessage();
-}
-
 function ToggleInlineAttachment(target)
 {
     var viewAttachmentInline = !Services.prefs.getBoolPref("mail.inline_attachments");
     Services.prefs.setBoolPref("mail.inline_attachments", viewAttachmentInline)
     target.setAttribute("checked", viewAttachmentInline ? "true" : "false");
 
     ReloadMessage();
 }
@@ -2879,20 +2854,16 @@ function ClearPendingReadTimer()
   {
     clearTimeout(gMarkViewedMessageAsReadTimer);
     gMarkViewedMessageAsReadTimer = null;
   }
 }
 
 function OnMsgParsed(aUrl)
 {
-  // If rss feed (has 'content-base' header), show summary or load web
-  // page per pref; earliest we have content DOM is here (onMsgParsed).
-  FeedSetContentView();
-
   gMessageNotificationBar.setPhishingMsg(aUrl);
 
   // notify anyone (e.g., extensions) who's interested in when a message is loaded.
   var msgURI = GetLoadedMessage();
   Services.obs.notifyObservers(msgWindow.msgHeaderSink,
                                "MsgMsgDisplayed", msgURI);
 
   // scale any overflowing images
@@ -3096,146 +3067,16 @@ function OpenOrFocusWindow(args, windowT
     desiredWindow.focus();
     if ("refresh" in args && args.refresh)
       desiredWindow.refresh();
   }
   else
     window.openDialog(chromeURL, "", "chrome,resizable,status,centerscreen,dialog=no", args);
 }
 
-// Switch between message body (feed summary) and content-base url in
-// the Message Pane, called in MsgOpenSelectedMessages
-function FeedSetContentViewToggle()
-{
-  gShowFeedSummaryToggle = true;
-  FeedSetContentView(gShowFeedSummary ? 0 : 1);
-}
-
-// Check message format
-function FeedCheckContentFormat()
-{
-  // Not an rss message. This also rules out no 3pane to get the browser of.
-  if (!gFolderDisplay.selectedMessageIsFeed)
-    return false;
-
-  var contentWindowDoc = getBrowser().contentDocument;
-
-  // Thunderbird 2 rss messages with 'Show article summary' not selected,
-  // ie message body constructed to show web page in an iframe, can't show
-  // a summary - notify user.
-  var rssIframe = contentWindowDoc.getElementById('_mailrssiframe');
-  if (rssIframe) {
-    if (gShowFeedSummaryToggle || Services.prefs.getIntPref("rss.show.summary") == 1)
-      gShowFeedSummaryToggle = false;
-    return false;
-  }
-
-  return true;
-}
-
-// View summary or load web page for feeds
-function FeedSetContentView(val)
-{
-  // Check it..
-  if (!FeedCheckContentFormat())
-    return;
-
-  var showSummary;
-  var wintype = document.documentElement.getAttribute('windowtype');
-  var contentBase = currentHeaderData["content-base"];
-  var contentWindowDoc = getBrowser().contentDocument;
-  var divHTML = new XPCNativeWrapper(contentWindowDoc,
-                      "getElementsByClassName()")
-                      .getElementsByClassName("moz-text-html")[0];
-  var divPLAIN = new XPCNativeWrapper(contentWindowDoc,
-                      "getElementsByClassName()")
-                      .getElementsByClassName("moz-text-plain")[0];
-
-  if (val == null)
-    // Not passed a value, so generic select unless in toggle mode
-    if (!gShowFeedSummaryToggle)
-      // Not in toggle mode, get prefs
-      val = Services.prefs.getIntPref("rss.show.summary");
-    else {
-      // Coming in again from toggle, summary already 'reloadMessage'ed,
-      // just need to set display for summary on.
-      gShowFeedSummaryToggle = false;
-      if (divHTML)
-        divHTML.parentNode.setAttribute("selected", gShowFeedSummary);
-      if (divPLAIN)
-        divPLAIN.parentNode.setAttribute("selected", gShowFeedSummary);
-      return;
-    }
-
-  switch (val) {
-    case 0:
-      showSummary = false;
-      break;
-    case 1:
-      showSummary = true
-      break;
-    case 2:
-      if (wintype == "mail:3pane") {
-        // Get quickmode per feed pref from feeds.rdf
-        var quickMode, targetRes;
-        try
-        {
-          targetRes = FeedUtils.getParentTargetForChildResource(
-                        gFolderDisplay.displayedFolder.URI,
-                        FeedUtils.FZ_QUICKMODE,
-                        gFolderDisplay.displayedFolder.server);
-        }
-        catch (ex) {};
-
-        if (targetRes)
-        {
-          quickMode = targetRes.QueryInterface(Ci
-                               .nsIRDFLiteral);
-          quickMode = quickMode.Value;
-          quickMode = eval(quickMode);
-        }
-        else
-          // Do not have this item's feed anymore in feeds.rdf though its
-          // message folder remains and its items exist in feeditems.rdf
-          // (Bug 309449), or the item has been moved to another folder,
-          // or some error on the file. Default to show summary.
-          quickMode = true;
-      }
-      showSummary = quickMode;
-      break;
-  }
-
-  gShowFeedSummary = showSummary;
-
-  // Message window - here only if GetFeedOpenHandler() = 0 or 1
-  if (wintype == "mail:messageWindow") {
-    // Set global var for message window
-    gShowFeedSummary = GetFeedOpenHandler();
-    // Get pref since may be reusable message window and changed in 3pane
-    showSummary = gShowFeedSummary == 0 ? false : true;
-  }
-
-  if (divHTML)
-    divHTML.parentNode.setAttribute("selected", showSummary);
-  if (divPLAIN)
-    divPLAIN.parentNode.setAttribute("selected", showSummary);
-
-  if (showSummary) {
-    if (gShowFeedSummaryToggle) {
-      if (gDBView && GetNumSelectedMessages() == 1) {
-        ReloadMessage();
-      }
-    }
-  }
-  else if(contentBase.headerValue) {
-    getMessageBrowser().loadURI(contentBase.headerValue, null, null);
-    gShowFeedSummaryToggle = false;
-  }
-}
-
 function getMailToolbox()
 {
   return document.getElementById("mail-toolbox");
 }
 
 function MailToolboxCustomizeInit()
 {
   toolboxCustomizeInit("mail-menubar");
--- a/suite/mailnews/content/mailWindowOverlay.xul
+++ b/suite/mailnews/content/mailWindowOverlay.xul
@@ -1273,42 +1273,42 @@
                     label="&bodyAllowHTML.label;"
                     accesskey="&bodyAllowHTML.accesskey;"
                     oncommand="MsgFeedBodyRenderPrefs(false, 0, 0)"/>
           <menuitem id="bodyFeedSummarySanitized"
                     type="radio"
                     name="viewFeedBodyHTMLGroup"
                     label="&bodySanitized.label;"
                     accesskey="&bodySanitized.accesskey;"
-                    oncommand="MsgFeedBodyRenderPrefs(false, 3, disallow_classes_no_html)"/>
+                    oncommand="MsgFeedBodyRenderPrefs(false, 3, gDisallow_classes_no_html)"/>
           <menuitem id="bodyFeedSummaryAsPlaintext"
                     type="radio"
                     name="viewFeedBodyHTMLGroup"
                     label="&bodyAsPlaintext.label;"
                     accesskey="&bodyAsPlaintext.accesskey;"
-                    oncommand="MsgFeedBodyRenderPrefs(true, 1, disallow_classes_no_html)"/>
+                    oncommand="MsgFeedBodyRenderPrefs(true, 1, gDisallow_classes_no_html)"/>
           <menuseparator id="viewFeedSummarySeparator"/>
           <menuitem id="bodyFeedGlobalWebPage"
                     type="radio"
                     name="viewFeedSummaryGroup"
                     label="&viewFeedWebPage.label;"
                     accesskey="&viewFeedWebPage.accesskey;"
-                    oncommand="ChangeFeedShowSummaryPref(0)"/>
+                    oncommand="FeedMessageHandler.onSelectPref = 0"/>
           <menuitem id="bodyFeedGlobalSummary"
                     type="radio"
                     name="viewFeedSummaryGroup"
                     label="&viewFeedSummary.label;"
                     accesskey="&viewFeedSummary.accesskey;"
-                    oncommand="ChangeFeedShowSummaryPref(1)"/>
+                    oncommand="FeedMessageHandler.onSelectPref = 1"/>
           <menuitem id="bodyFeedPerFolderPref"
                     type="radio"
                     name="viewFeedSummaryGroup"
                     label="&viewFeedSummaryFeedPropsPref.label;"
                     accesskey="&viewFeedSummaryFeedPropsPref.accesskey;"
-                    oncommand="ChangeFeedShowSummaryPref(2)"/>
+                    oncommand="FeedMessageHandler.onSelectPref = 2"/>
         </menupopup>
       </menu>
       <menuitem id="viewAttachmentsInlineMenuitem"
                 type="checkbox"
                 checked="true"
                 label="&viewAttachmentsInlineCmd.label;"
                 accesskey="&viewAttachmentsInlineCmd.accesskey;"
                 oncommand="ToggleInlineAttachment(event.target)"/>
@@ -1518,29 +1518,29 @@
             label="&openFeedMessage.label;"
             accesskey="&openFeedMessage.accesskey;">
         <menupopup id="menu_openFeedMessage">
           <menuitem id="menu_openFeedWebPageInWindow"
                     type="radio"
                     name="openFeedGroup"
                     label="&openFeedWebPageInWindow.label;"
                     accesskey="&openFeedWebPageInWindow.accesskey;"
-                    oncommand="ChangeFeedOpenHandler(0);"/>
+                    oncommand="FeedMessageHandler.onOpenPref = 0"/>
           <menuitem id="menu_openFeedSummaryInWindow"
                     type="radio"
                     name="openFeedGroup"
                     label="&openFeedSummaryInWindow.label;"
                     accesskey="&openFeedSummaryInWindow.accesskey;"
-                    oncommand="ChangeFeedOpenHandler(1);"/>
+                    oncommand="FeedMessageHandler.onOpenPref = 1"/>
           <menuitem id="menu_openFeedWebPageInMessagePane"
                     type="radio"
                     name="openFeedGroup"
                     label="&openFeedWebPageInMP.label;"
                     accesskey="&openFeedWebPageInMP.accesskey;"
-                    oncommand="ChangeFeedOpenHandler(2);"/>
+                    oncommand="FeedMessageHandler.onOpenPref = 2"/>
         </menupopup>
       </menu>
      <menuseparator id="messageAfterOpenMsgSeparator"/>
      <menu id="msgAttachmentMenu" label="&openAttachmentCmd.label;"
            accesskey="&openAttachmentCmd.accesskey;" disabled="true">
        <menupopup id="attachmentMenuList" onpopupshowing="FillAttachmentListPopup(this);"/>
      </menu>
      <menuseparator id="messageAfterAttachmentMenuSeparator"/>
--- a/suite/mailnews/content/msgHdrViewOverlay.js
+++ b/suite/mailnews/content/msgHdrViewOverlay.js
@@ -380,16 +380,22 @@ var messageHeaderSink = {
 
     onEndHeaders: function()
     {
       ClearHeaderView(gCollapsedHeaderView);
       ClearHeaderView(gExpandedHeaderView);
 
       EnsureSubjectValue(); // make sure there is a subject even if it's empty so we'll show the subject and the twisty
 
+      // Load feed web page if so configured. This entry point works for
+      // messagepane loads in 3pane folder tab, 3pane message tab, and the
+      // standalone message window.
+      if (!FeedMessageHandler.shouldShowSummary(gMessageDisplay.displayedMessage, false))
+        FeedMessageHandler.setContent(gMessageDisplay.displayedMessage, false);
+
       ShowMessageHeaderPane();
       UpdateMessageHeaders();
       ShowEditMessageBox();
 
       for (let index in gMessageListeners)
         gMessageListeners[index].onEndHeaders();
     },
 
--- a/suite/themes/classic/messenger/messageBody.css
+++ b/suite/themes/classic/messenger/messageBody.css
@@ -130,21 +130,16 @@
   cursor: zoom-out;
 }
 
 .moz-attached-image[isshrunk="true"] {
   cursor: zoom-in;
   max-width: 100%;
 }
 
-/* New style feed summary body. */
-body[selected="false"] {
-  display: none;
-}
-
 /* Old style feeds. */
 #_mailrssiframe {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   border: none;
--- a/suite/themes/modern/messenger/messageBody.css
+++ b/suite/themes/modern/messenger/messageBody.css
@@ -134,21 +134,16 @@
   cursor: zoom-out;
 }
 
 .moz-attached-image[isshrunk="true"] {
   cursor: zoom-in;
   max-width: 100%;
 }
 
-/* New style feed summary body. */
-body[selected="false"] {
-  display: none;
-}
-
 /* Old style feeds. */
 #_mailrssiframe {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   border: none;