Bug 423486 - Remove help viewer from Firefox and point to SUMO, r=gavin, ui-r=beltzner, a1.9b5=beltzner
authormconnor@steelgryphon.com
Mon, 24 Mar 2008 10:18:38 -0700
changeset 13505 cd0cef924b06d38598c049bc0d376d28b8d1e597
parent 13504 119794c257198d7fca7ca2bac9c25bb2fc2aab44
child 13506 c1ccea2f41d63b9b9a6b9caff4169d1fa2968af4
push id2
push userjorendorff@mozilla.com
push dateWed, 26 Mar 2008 17:39:06 +0000
treeherdermozilla-central@1d969540aa4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, beltzner
bugs423486
milestone1.9b5pre
Bug 423486 - Remove help viewer from Firefox and point to SUMO, r=gavin, ui-r=beltzner, a1.9b5=beltzner
browser/app/profile/firefox.js
browser/base/content/baseMenuOverlay.xul
browser/base/content/pageinfo/pageInfo.js
browser/base/content/pageinfo/pageInfo.xul
browser/base/content/utilityOverlay.js
browser/components/preferences/advanced-scripts.xul
browser/components/preferences/advanced.xul
browser/components/preferences/applications.xul
browser/components/preferences/colors.xul
browser/components/preferences/connection.xul
browser/components/preferences/content.xul
browser/components/preferences/fonts.xul
browser/components/preferences/languages.xul
browser/components/preferences/main.xul
browser/components/preferences/preferences.xul
browser/components/preferences/privacy.xul
browser/components/preferences/sanitize.xul
browser/components/preferences/security.xul
browser/components/preferences/tabs.xul
browser/locales/jar.mn
toolkit/components/Makefile.in
toolkit/content/widgets/preferences.xml
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -720,8 +720,11 @@ pref("browser.zoom.full", true);
 // Whether or not to save and restore zoom levels on a per-site basis.
 pref("browser.zoom.siteSpecific", true);
 
 // replace newlines with spaces when pasting into <input type="text"> fields
 pref("editor.singleLine.pasteNewlines", 2);
 
 // The breakpad report server to link to in about:crashes
 pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/");
+
+// base URL for web-based support pages
+pref("app.support.baseURL", "http://support.mozilla.com/1/%APP%/%VERSION%/%OS%/%LOCALE%/");
--- a/browser/base/content/baseMenuOverlay.xul
+++ b/browser/base/content/baseMenuOverlay.xul
@@ -44,17 +44,16 @@
 <!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
 %baseMenuOverlayDTD;
 ]>
 <overlay id="baseMenuOverlay"
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
-<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
 
 #ifdef XP_MACOSX
 <!-- nsMenuBarX hides these and uses them to build the Application menu.
      When using Carbon widgets for Mac OS X widgets, some of these are not
      used as they only apply to Cocoa widget builds. All version of Firefox
      through Firefox 2 will use Carbon widgets. -->
     <menupopup id="menu_ToolsPopup">
         <menuitem id="menu_preferences" label="&preferencesCmdMac.label;" key="key_preferencesCmdMac" oncommand="openPreferences();"/>
@@ -72,31 +71,30 @@
           label="&helpMenuWin.label;"
           accesskey="&helpMenuWin.accesskey;">
 #else
     <menu id="helpMenu"
           label="&helpMenu.label;"
           accesskey="&helpMenu.accesskey;">
 #endif
       <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
-        <menuitem id="menu_openHelp"
-                  oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
+        <menuitem oncommand="openHelpLink('firefox-help')"
 #ifdef XP_MACOSX
                   label="&helpContentsMac.label;"
                   key="key_openHelpMacFrontend"/>
 #else
                   label="&helpContents.label;"
                   accesskey="&helpContents.accesskey;"
                   key="key_openHelp"/>
 #endif
 # Show IE Users menu item on Windows only
 #ifdef XP_WIN
         <menuitem label="&helpForIEUsers.label;"
                   accesskey="&helpForIEUsers.accesskey;"
-                  oncommand="openHelp('ieusers', 'chrome://browser/locale/help/help.rdf');"/>
+                  oncommand="openHelpLink('ieusers');"/>
 #endif
         <menuitem id="releaseNotes"
                   accesskey="&helpReleaseNotes.accesskey;"
                   label="&helpReleaseNotes.label;"
                   oncommand="openReleaseNotes(event)"
                   onclick="checkForMiddleClick(this, event);"/>
         <menuseparator id="updateSeparator"/>
         <menuitem id="checkForUpdates"
@@ -112,17 +110,17 @@
       </menupopup>
     </menu>
 
     <keyset id="baseMenuKeyset">
 #ifdef XP_MACOSX
 <!-- On mac, we map Cmd+Shift+/, but show Cmd+?
      (that's for en-US, it might be different for other keyboard layouts) -->
         <key id="key_openHelpMac"
-             oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
+             oncommand="openHelpLink('firefox-help');"
              key="&openHelpMac.commandkey;"
              modifiers="&openHelpMac.modifiers;"/>
         <key id="key_openHelpMacFrontend"
              key="&openHelpMac.frontendCommandkey;"
              modifiers="&openHelpMac.frontendModifiers;"/>
 <!-- These are used to build the Application menu under Cocoa widgets -->
         <key id="key_preferencesCmdMac"
              key="&preferencesCmdMac.commandkey;"
@@ -130,17 +128,17 @@
         <key id="key_hideThisAppCmdMac"
              key="&hideThisAppCmdMac.commandkey;"
              modifiers="&hideThisAppCmdMac.modifiers;"/>
         <key id="key_hideOtherAppsCmdMac"
              key="&hideOtherAppsCmdMac.commandkey;"
              modifiers="&hideOtherAppsCmdMac.modifiers;"/>
 #else
         <key id="key_openHelp"
-            oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
+            oncommand="openHelpLink('firefox-help');"
             keycode="&openHelp.commandkey;"/>
 #endif
     </keyset>
 
     <stringbundleset id="stringbundleset">
         <stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
         <stringbundle id="bundle_browser_region" src="chrome://browser-region/locale/region.properties"/>
     </stringbundleset>
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -387,17 +387,17 @@ function doHelpButton()
     "mediaPanel":    "pageinfo_media",
     "feedPanel":     "pageinfo_feed",
     "permPanel":     "pageinfo_permissions",
     "securityPanel": "pageinfo_security"
   };
 
   var deck  = document.getElementById("mainDeck");
   var helpdoc = helpTopics[deck.selectedPanel.id] || "pageinfo_general";
-  openHelp(helpdoc, 'chrome://browser/locale/help/help.rdf');
+  openHelpLink(helpdoc);
 }
 
 function showTab(id)
 {
   var deck  = document.getElementById("mainDeck");
   var pagel = document.getElementById(id + "Panel");
   deck.selectedPanel = pagel;
 }
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -66,17 +66,16 @@
 
   <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
   <script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/pageinfo/pageInfo.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/pageinfo/feeds.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/pageinfo/permissions.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/pageinfo/security.js"/>
   <script type="application/x-javascript" src="chrome://global/content/strres.js"/>
-  <script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
 
   <stringbundleset id="pageinfobundleset">
     <stringbundle id="pageinfobundle" src="chrome://browser/locale/pageInfo.properties"/>
   </stringbundleset>
 
   <commandset id="pageInfoCommandSet">
     <command id="cmd_close"     oncommand="window.close();"/>
@@ -95,18 +94,19 @@
     <command id="cmd_installToggle" oncommand="onRadioClick('install');"/>
   </commandset>
 
   <keyset>
     <key key="&closeWindow.key;" modifiers="accel" command="cmd_close"/>
     <key keycode="VK_ESCAPE"                       command="cmd_close"/>
 #ifdef XP_MACOSX
     <key key="."                 modifiers="meta"  command="cmd_close"/>
+#else
+    <key keycode="VK_F1"                           command="cmd_help"/>
 #endif
-    <key keycode="VK_F1"                           command="cmd_help"/>
     <key key="&copy.key;"        modifiers="accel" command="cmd_copy"/>
     <key key="&selectall.key;"   modifiers="accel" command="cmd_selectall"/>
     <key key="&selectall.key;"   modifiers="alt"   command="cmd_selectall"/>
   </keyset>
 
   <menupopup id="picontext">
     <menuitem label="&selectall.label;" command="cmd_selectall" accesskey="&selectall.accesskey;"/>
     <menuitem label="&copy.label;"      command="cmd_copy"      accesskey="&copy.accesskey;"/>
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -668,8 +668,30 @@ function getOfflineAppUsage(host)
 
   var storageManager = Components.classes["@mozilla.org/dom/storagemanager;1"].
                        getService(Components.interfaces.nsIDOMStorageManager);
   usage += storageManager.getUsage(host);
 
   return usage;
 }
 
+// aCalledFromModal is optional
+function openHelpLink(aHelpTopic, aCalledFromModal) {
+  var url = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
+                      .getService(Components.interfaces.nsIURLFormatter)
+                      .formatURLPref("app.support.baseURL");
+  url += aHelpTopic;
+
+  var where = aCalledFromModal ? "window" : "tab";
+  openUILinkIn(url, where);
+}
+
+function openPrefsHelp() {
+  var prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                        .getService(Components.interfaces.nsIPrefBranch2);
+
+  // non-instant apply prefwindows are usually modal, so we can't open in the topmost window, 
+  // since its probably behind the window.
+  var instantApply = prefs.getBoolPref("browser.preferences.instantApply");
+
+  var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic;
+  openHelpLink(helpTopic, !instantApply);
+}
--- a/browser/components/preferences/advanced-scripts.xul
+++ b/browser/components/preferences/advanced-scripts.xul
@@ -40,20 +40,23 @@
 
 <!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/advanced-scripts.dtd">
 
 <?xml-stylesheet href="chrome://global/skin/"?>
 
 <prefwindow id="AdvancedJSDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&advancedJSDialog.title;"
-            dlgbuttons="accept,cancel,help">
+            dlgbuttons="accept,cancel,help"
+            ondialoghelp="openPrefsHelp()">
+
+  <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
 
   <prefpane id="AdvancedJSDialogPane"
-            helpTopic="prefs-advanced-javascript" helpURI="chrome://browser/locale/help/help.rdf">
+            helpTopic="prefs-advanced-javascript">
 
     <preferences>
      <preference id="dom.event.contextmenu.enabled"  name="dom.event.contextmenu.enabled"  type="bool"/>
      <preference id="dom.disable_window_move_resize" name="dom.disable_window_move_resize" type="bool" inverted="true"/>
      <preference id="dom.disable_window_flip"        name="dom.disable_window_flip"        type="bool" inverted="true"/>
      <preference id="dom.disable_window_open_feature.status" inverted="true"
                  name="dom.disable_window_open_feature.status" type="bool"/>
      <preference id="dom.disable_window_status_change" inverted="true"
--- a/browser/components/preferences/advanced.xul
+++ b/browser/components/preferences/advanced.xul
@@ -47,18 +47,17 @@
 %advancedDTD;
 <!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd">
 %privacyDTD;
 ]>
 
 <overlay id="AdvancedPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();"
-            helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();">
 
     <preferences id="advancedPreferences">
       <preference id="browser.preferences.advanced.selectedTabIndex"
                   name="browser.preferences.advanced.selectedTabIndex"
                   type="int"/>
 
       <!--XXX button prefs -->
 
--- a/browser/components/preferences/applications.xul
+++ b/browser/components/preferences/applications.xul
@@ -48,18 +48,20 @@
   <!ENTITY % applicationsDTD SYSTEM "chrome://browser/locale/preferences/applications.dtd">
   %brandDTD;
   %applicationsDTD;
 ]>
 
 <overlay id="ApplicationsPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <prefpane id="paneApplications" onpaneload="gApplicationsPane.init();" flex="1"
-            helpTopic="prefs-applications" helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="paneApplications"
+            onpaneload="gApplicationsPane.init();"
+            flex="1"
+            helpTopic="prefs-applications">
 
     <preferences id="feedsPreferences">
       <preference id="browser.feeds.handler"
                   name="browser.feeds.handler"
                   type="string"/>
       <preference id="browser.feeds.handler.default"
                   name="browser.feeds.handler.default"
                   type="string"/>
--- a/browser/components/preferences/colors.xul
+++ b/browser/components/preferences/colors.xul
@@ -44,24 +44,26 @@
 #endif
 
 <!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/colors.dtd" >
 
 <prefwindow id="ColorsDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&colorsDialog.title;"
             dlgbuttons="accept,cancel,help"
+            ondialoghelp="openPrefsHelp()"
 #ifdef XP_MACOSX
             style="width: &window.macWidth; !important;">
 #else
             style="width: &window.width; !important;">
 #endif
 
+  <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
   <prefpane id="ColorsDialogPane"
-            helpTopic="prefs-fonts-and-colors" helpURI="chrome://browser/locale/help/help.rdf">
+            helpTopic="prefs-fonts-and-colors">
   
     <preferences>
       <preference id="browser.display.use_document_colors"  name="browser.display.use_document_colors"  type="bool"/>
       <preference id="browser.anchor_color"                 name="browser.anchor_color"                 type="string"/>
       <preference id="browser.visited_color"                name="browser.visited_color"                type="string"/>
       <preference id="browser.underline_anchors"            name="browser.underline_anchors"            type="bool"/>
       <preference id="browser.display.foreground_color"     name="browser.display.foreground_color"     type="string"/>
       <preference id="browser.display.background_color"     name="browser.display.background_color"     type="string"/>
--- a/browser/components/preferences/connection.xul
+++ b/browser/components/preferences/connection.xul
@@ -43,24 +43,27 @@
 <?xml-stylesheet href="chrome://global/skin/"?>
 
 <prefwindow id="ConnectionsDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&connectionsDialog.title;"
             dlgbuttons="accept,cancel,help"
             onbeforeaccept="return gConnectionsDialog.beforeAccept();"
             onload="gConnectionsDialog.checkForSystemProxy();"
+            ondialoghelp="openPrefsHelp()"
 #ifdef XP_MACOSX
             style="width: &window.macWidth; !important;">
 #else
             style="width: &window.width; !important;">
 #endif
 
+  <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
+
   <prefpane id="ConnectionsDialogPane"
-            helpTopic="prefs-connection-settings" helpURI="chrome://browser/locale/help/help.rdf">
+            helpTopic="prefs-connection-settings">
 
     <preferences>
       <preference id="network.proxy.type"         name="network.proxy.type"         type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/>
       <preference id="network.proxy.http"         name="network.proxy.http"         type="string"/>
       <preference id="network.proxy.http_port"    name="network.proxy.http_port"    type="int"/>
       <preference id="network.proxy.ftp"          name="network.proxy.ftp"          type="string"/>
       <preference id="network.proxy.ftp_port"     name="network.proxy.ftp_port"     type="int"/>
       <preference id="network.proxy.ssl"          name="network.proxy.ssl"          type="string"/>
--- a/browser/components/preferences/content.xul
+++ b/browser/components/preferences/content.xul
@@ -44,18 +44,19 @@
   <!ENTITY % contentDTD SYSTEM "chrome://browser/locale/preferences/content.dtd">
   %brandDTD;
   %contentDTD;
 ]>
 
 <overlay id="ContentPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <prefpane id="paneContent" onpaneload="gContentPane.init();"
-            helpTopic="prefs-content" helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="paneContent" 
+            onpaneload="gContentPane.init();"
+            helpTopic="prefs-content">
 
     <preferences id="contentPreferences">
       <!--XXX buttons prefs -->
 
       <!-- POPUPS, IMAGES, JAVASCRIPT -->
       <preference id="dom.disable_open_during_load"   name="dom.disable_open_during_load"   type="bool"/>
       <preference id="permissions.default.image"      name="permissions.default.image"      type="int"/>
       <preference id="javascript.enabled"             name="javascript.enabled"             type="bool"/>
--- a/browser/components/preferences/fonts.xul
+++ b/browser/components/preferences/fonts.xul
@@ -47,28 +47,31 @@
 #endif
 
 <!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/fonts.dtd" >
 
 <prefwindow id="FontsDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&fontsDialog.title;"
             dlgbuttons="accept,cancel,help"
+            ondialoghelp="openPrefsHelp()"
 #ifdef XP_UNIX
 #ifdef XP_MACOSX
             style="width: &window.macWidth; !important;">
 #else
             style="width: &window.unixWidth; !important;">
 #endif
 #else
             style="width: &window.width; !important;">
 #endif
 
+  <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
+
   <prefpane id="FontsDialogPane"
-            helpTopic="prefs-fonts-and-colors" helpURI="chrome://browser/locale/help/help.rdf">
+            helpTopic="prefs-fonts-and-colors">
   
     <preferences id="fontPreferences">
       <preference id="font.language.group"  name="font.language.group"  type="wstring"/>
       <preference id="browser.display.use_document_fonts"
                   name="browser.display.use_document_fonts"
                   type="int"/>
       <preference id="intl.charset.default" name="intl.charset.default" type="wstring"/>
     </preferences>
--- a/browser/components/preferences/languages.xul
+++ b/browser/components/preferences/languages.xul
@@ -45,20 +45,24 @@
 #ifdef XP_MACOSX
 <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
 #endif
 
 <prefwindow id="LanguagesDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&languages.customize.Header;"
             dlgbuttons="accept,cancel,help"
+            ondialoghelp="openPrefsHelp()"
             style="width: &window.width;;">
 
-  <prefpane id="LanguagesDialogPane" onpaneload="gLanguagesDialog.init();"
-            helpTopic="prefs-languages" helpURI="chrome://browser/locale/help/help.rdf">
+  <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
+
+  <prefpane id="LanguagesDialogPane"
+            onpaneload="gLanguagesDialog.init();"
+            helpTopic="prefs-languages">
 
     <preferences>
       <preference id="intl.accept_languages" name="intl.accept_languages" type="wstring"/>
       <preference id="pref.browser.language.disable_button.up"
                   name="pref.browser.language.disable_button.up"
                   type="bool"/>
       <preference id="pref.browser.language.disable_button.down"
                   name="pref.browser.language.disable_button.down"
--- a/browser/components/preferences/main.xul
+++ b/browser/components/preferences/main.xul
@@ -45,18 +45,19 @@
   <!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd">
   %brandDTD;
   %mainDTD;
 ]>
 
 <overlay id="MainPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
            
-  <prefpane id="paneMain" onpaneload="gMainPane.init();"
-            helpTopic="prefs-main" helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="paneMain" 
+            onpaneload="gMainPane.init();"
+            helpTopic="prefs-main">
 
     <script type="application/x-javascript" src="chrome://browser/content/preferences/main.js"/>
 
     <preferences id="mainPreferences">
       <!-- XXX Button preferences -->
 
       <!-- Startup -->
       <preference id="browser.startup.page"
--- a/browser/components/preferences/preferences.xul
+++ b/browser/components/preferences/preferences.xul
@@ -67,16 +67,17 @@
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 #endif
 
 <prefwindow type="prefwindow"
             id="BrowserPreferences"
             windowtype="Browser:Preferences"
+            ondialoghelp="openPrefsHelp()"
 #ifdef USE_WIN_TITLE_STYLE
             title="&prefWindow.titleWin;"
 #else
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
             title="&prefWindow.titleGNOME;"
 #endif
 #endif
@@ -87,16 +88,18 @@
 #else
 #ifdef XP_MACOSX
             style="&prefWin.styleMac2;">
 #else
             style="&prefWin.styleGNOME2;">
 #endif
 #endif
 
+    <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
+
     <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="bundlePreferences"
                   src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <prefpane id="paneMain" label="&paneMain.title;"
               src="chrome://browser/content/preferences/main.xul"/>
     <prefpane id="paneTabs" label="&paneTabs.title;"
               src="chrome://browser/content/preferences/tabs.xul"/>
--- a/browser/components/preferences/privacy.xul
+++ b/browser/components/preferences/privacy.xul
@@ -44,19 +44,19 @@
 <!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd">
 %brandDTD;
 %privacyDTD;
 ]>
 
 <overlay id="PrivacyPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <prefpane id="panePrivacy" onpaneload="gPrivacyPane.init();"
-            helpTopic="prefs-privacy"
-            helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="panePrivacy"
+            onpaneload="gPrivacyPane.init();"
+            helpTopic="prefs-privacy">
 
     <preferences id="privacyPreferences">
 
       <!-- XXX button prefs -->
       <preference id="pref.privacy.disable_button.cookie_exceptions"
                   name="pref.privacy.disable_button.cookie_exceptions"
                   type="bool"/>
       <preference id="pref.privacy.disable_button.view_cookies"
--- a/browser/components/preferences/sanitize.xul
+++ b/browser/components/preferences/sanitize.xul
@@ -45,20 +45,23 @@
   <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
   %brandDTD;
   %sanitizeDTD;
 ]>
 
 <prefwindow id="SanitizeDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             dlgbuttons="accept,cancel,help"
+            ondialoghelp="openPrefsHelp()"
             title="&sanitizeDialog.title;">
 
+  <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
+
   <prefpane id="SanitizeDialogPane"
-            helpTopic="prefs-clear-private-data" helpURI="chrome://browser/locale/help/help.rdf">
+            helpTopic="prefs-clear-private-data">
 
     <preferences>
       <preference id="privacy.item.history"               name="privacy.item.history"               type="bool"/>
       <preference id="privacy.item.formdata"              name="privacy.item.formdata"              type="bool"/>
       <preference id="privacy.item.passwords"             name="privacy.item.passwords"             type="bool"/>
       <preference id="privacy.item.downloads"             name="privacy.item.downloads"             type="bool"/>
       <preference id="privacy.item.cookies"               name="privacy.item.cookies"               type="bool"/>
       <preference id="privacy.item.cache"                 name="privacy.item.cache"                 type="bool"/>
--- a/browser/components/preferences/security.xul
+++ b/browser/components/preferences/security.xul
@@ -42,18 +42,19 @@
   <!ENTITY % securityDTD SYSTEM "chrome://browser/locale/preferences/security.dtd">
   %brandDTD;
   %securityDTD;
 ]>
 
 <overlay id="SecurityPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <prefpane id="paneSecurity" onpaneload="gSecurityPane.init();"
-            helpTopic="prefs-security" helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="paneSecurity"
+            onpaneload="gSecurityPane.init();"
+            helpTopic="prefs-security">
 
     <preferences id="securityPreferences">
       <!-- XXX buttons -->
       <preference id="pref.privacy.disable_button.view_passwords"
                   name="pref.privacy.disable_button.view_passwords"
                   type="bool"/>
       <preference id="pref.privacy.disable_button.view_passwords_exceptions"
                   name="pref.privacy.disable_button.view_passwords_exceptions"
--- a/browser/components/preferences/tabs.xul
+++ b/browser/components/preferences/tabs.xul
@@ -44,17 +44,18 @@
 %brandDTD;
 <!ENTITY % tabsDTD SYSTEM "chrome://browser/locale/preferences/tabs.dtd">
 %tabsDTD;
 ]>
 
 <overlay id="TabsPaneOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <prefpane id="paneTabs" helpTopic="prefs-tabs" helpURI="chrome://browser/locale/help/help.rdf">
+  <prefpane id="paneTabs"
+            helpTopic="prefs-tabs">
 
     <preferences id="tabsPreferences">
       <preference id="browser.link.open_external"      name="browser.link.open_external"      type="int"/>
       <preference id="browser.link.open_newwindow"     name="browser.link.open_newwindow"     type="int"/>
       <preference id="browser.tabs.autoHide"           name="browser.tabs.autoHide"           type="bool" inverted="true"/>
       <preference id="browser.tabs.loadInBackground"   name="browser.tabs.loadInBackground"   type="bool" inverted="true"/>
       <preference id="browser.tabs.warnOnClose"        name="browser.tabs.warnOnClose"        type="bool"/>
       <preference id="browser.tabs.warnOnOpen"         name="browser.tabs.warnOnOpen"         type="bool"/>
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -64,16 +64,17 @@
     locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
     locale/browser/preferences/privacy.dtd            (%chrome/browser/preferences/privacy.dtd)
     locale/browser/preferences/security.dtd           (%chrome/browser/preferences/security.dtd)
     locale/browser/preferences/securityWarnings.dtd   (%chrome/browser/preferences/securityWarnings.dtd)
     locale/browser/preferences/tabs.dtd               (%chrome/browser/preferences/tabs.dtd)
     locale/browser/sidebar/sidebar.properties      (%chrome/browser/sidebar/sidebar.properties)
 % locale browser-region @AB_CD@ %locale/browser-region/
     locale/browser-region/region.properties        (%chrome/browser-region/region.properties)
+#ifdef MOZ_HELP_VIEWER
     locale/browser/help/help.rdf                      (%chrome/help/firebirdhelp.rdf)
     locale/browser/help/firebird-toc.rdf              (%chrome/help/firebird-toc.rdf)
     locale/browser/help/search-db.rdf                 (%chrome/help/search-db.rdf)
     locale/browser/help/accessibility.xhtml           (%chrome/help/accessibility.xhtml)
     locale/browser/help/cookies.xhtml                 (%chrome/help/cookies.xhtml)
     locale/browser/help/forieusers.xhtml              (%chrome/help/forieusers.xhtml)
     locale/browser/help/menu_reference.xhtml          (%chrome/help/menu_reference.xhtml)
     locale/browser/help/mouse_shortcuts.xhtml         (%chrome/help/mouse_shortcuts.xhtml)
@@ -82,16 +83,17 @@
     locale/browser/help/shortcuts.xhtml               (%chrome/help/shortcuts.xhtml)
     locale/browser/help/using_firebird.xhtml          (%chrome/help/using_firebird.xhtml)
     locale/browser/help/customization.xhtml           (%chrome/help/customization.xhtml)
     locale/browser/help/firefox_welcome.xhtml         (%chrome/help/firefox_welcome.xhtml)
     locale/browser/help/download_manager.xhtml        (%chrome/help/download_manager.xhtml)
     locale/browser/help/platformStrings.dtd           (%chrome/help/platformStrings.dtd)
     locale/browser/help/tabbed_browsing.xhtml         (%chrome/help/tabbed_browsing.xhtml)
     locale/browser/help/glossary.xhtml                (%chrome/help/glossary.xhtml)
+#endif
 # the following files are browser-specific overrides
 *   locale/browser/netError.dtd                (%chrome/overrides/netError.dtd)
 *   locale/browser/appstrings.properties       (%chrome/overrides/appstrings.properties)
 *   locale/browser/downloads/settingsChange.dtd  (%chrome/overrides/settingsChange.dtd)
 % override chrome://global/locale/netErrorApp.dtd chrome://browser/locale/netError.dtd
 % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
 % override chrome://mozapps/locale/downloads/settingsChange.dtd chrome://browser/locale/downloads/settingsChange.dtd
 #ifdef MOZ_USE_GENERIC_BRANDING
--- a/toolkit/components/Makefile.in
+++ b/toolkit/components/Makefile.in
@@ -70,16 +70,20 @@ TOOL_DIRS += alerts
 else
 DIRS += alerts
 endif
 
 ifdef MOZ_FEEDS
 DIRS += feeds
 endif
 
+ifdef MOZ_HELP_VIEWER
+DIRS += help
+endif
+
 ifdef MOZ_PLACES
 DIRS += places
 endif
 
 ifdef NS_PRINTING
 DIRS +=	printing
 endif
 
@@ -107,20 +111,16 @@ DIRS += passwordmgr/public
 else
 DIRS += passwordmgr
 ifndef MOZ_PLACES
 DIRS +=	history
 endif # MOZ_PLACES
 endif # MOZ_SUITE
 endif # MOZ_THUNDERBIRD
 
-ifdef MOZ_XUL
-DIRS += help
-endif
-
 ifndef MOZ_SUITE
 # XXX Suite doesn't want these just yet
 ifdef MOZ_RDF
 DIRS +=	downloads
 endif
 endif # MOZ_SUITE
 
 ifdef MOZ_URL_CLASSIFIER
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -650,17 +650,27 @@
       <property name="lastSelected" 
                 onget="return this.getAttribute('lastSelected');">
         <setter>
           this.setAttribute("lastSelected", val); 
           document.persist(this.id, "lastSelected");
           return val;
         </setter>          
       </property>
-      <field name="currentPane">null</field>
+      <property name="currentPane"
+                onset="return this._currentPane = val;">
+        <getter>
+          if (!this._currentPane)
+            this._currentPane = this.preferencePanes[0];
+          
+          return this._currentPane;
+        </getter> 
+      </property>
+      <field name="_currentPane">null</field>
+      
       
       <method name="_makePaneButton">
         <parameter name="aPaneElement"/>
         <body>
         <![CDATA[
           var radio = document.createElement("radio");
           radio.setAttribute("pane", aPaneElement.id);
           radio.setAttribute("label", aPaneElement.label);
@@ -739,17 +749,17 @@
         <body>
         <![CDATA[
 #ifdef XP_MACOSX
           var paneTitle = aPaneElement.label;
           if (paneTitle != "")
             document.title = paneTitle;
 #endif
           var helpButton = document.documentElement.getButton("help");
-          if (aPaneElement.hasAttribute("helpURI"))
+          if (aPaneElement.helpTopic)
             helpButton.hidden = false;
           else
             helpButton.hidden = true;
 
           // Find this pane's index in the deck and set the deck's 
           // selectedIndex to that value to switch to it.
           var prefpanes = this.preferencePanes;
           for (var i = 0; i < prefpanes.length; ++i) {
@@ -976,77 +986,18 @@
             var features = "resizable,dialog=no,centerscreen" + (aFeatures != "" ? ("," + aFeatures) : "");
             var parentWindow = (this.instantApply || !window.opener || window.opener.closed) ? window : window.opener;
             win = parentWindow.openDialog(aURL, "_blank", features, aParams);
           }
           return win;
         ]]>
         </body>
       </method>
-      
-      // copied from contextHelp.js
-      // Locate existing help window for this helpFileURI.
-      <method name="locateHelpWindow">
-        <parameter name="helpFileURI"/>
-        <body>
-        <![CDATA[
-          const wm = Components.classes['@mozilla.org/appshell/window-mediator;1']
-                               .getService(Components.interfaces.nsIWindowMediator);
-          const iterator = wm.getEnumerator("mozilla:help");
-          var topWindow = null;
-          var aWindow;
-
-          // Loop through help windows looking for one with selected helpFileURI
-          while (iterator.hasMoreElements()) {
-            aWindow = iterator.getNext();
-            if (aWindow.getHelpFileURI() == helpFileURI)
-              topWindow = aWindow;
-          }
-          return topWindow;
-        ]]>
-        </body>
-      </method>
-      
-      // copied from contextHelp.js
-      // Opens up the Help Viewer with the specified topic and helpFileURI.
-      <method name="openHelp">
-        <parameter name="topic"/>
-        <parameter name="helpFileURI"/>
-        <body>
-        <![CDATA[
-          // Try to find previously opened help.
-          var topWindow = this.locateHelpWindow(helpFileURI);
-
-          if (topWindow) {
-          // Open topic in existing window.
-            topWindow.focus();
-            topWindow.displayTopic(topic);
-          }
-          else {
-          // Open topic in new window.
-            const params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"]
-                                     .createInstance(Components.interfaces.nsIDialogParamBlock);
-            params.SetNumberStrings(2);
-            params.SetString(0, helpFileURI);
-            params.SetString(1, topic);
-            const ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
-                                 .getService(Components.interfaces.nsIWindowWatcher);
-            ww.openWindow(null, "chrome://help/content/help.xul", "_blank", "chrome,all,alwaysRaised,dialog=no", params);
-          }
-        ]]>
-        </body>
-      </method>
     </implementation>
     <handlers>
-      <handler event="dialoghelp">
-        // currentPane is set in _selectPane for prefwindows which aren't childs.
-        // So if there's no currentPane, just use the first pane.
-        var pane = this.currentPane ? this.currentPane : this.preferencePanes[0];
-        this.openHelp(pane.helpTopic, pane.getAttribute("helpURI"));
-      </handler>
       <handler event="dialogaccept">
       <![CDATA[
         if (!this._fireEvent("beforeaccept", this)) 
           return;
         
         if (this.type == "child" && window.opener) {
           var psvc = Components.classes["@mozilla.org/preferences-service;1"]
                                .getService(Components.interfaces.nsIPrefBranch);