Extensions support in SeaMonkey 2

  • History
  • Edit

Table of Contents

    1. The Basics
    2. Differences as compared to other toolkit/-based applications
    3. URLbar Icons
    4. The Statusbar
    5. Thunderbird 3
      1. gFolderDisplay API
      2. gMessageDisplay API
  • Tags
  • Files

Starting with SeaMonkey 2 Alpha 1 SeaMonkey will support toolkit/-style extensions. These type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions.

The Basics

To support SeaMonkey 2 as a target application, you need to add it to the list of target applications in the extensions install.rdf file. The code for that will look something like this:

<em:targetApplication>
  <!-- SeaMonkey -->
  <Description>
    <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
    <em:minVersion>2.0</em:minVersion>
    <em:maxVersion>2.0.*</em:maxVersion>
  </Description>
</em:targetApplication>

The install.js is not supported any more and should be removed.

Differences as compared to other toolkit/-based applications

  • You need to overlay/open different chrome URLs as compared to Firefox. Some URLs are listed below:

    URL in Firefox URL in SeaMonkey Overlays
    chrome://browser/content/browser.xul chrome://navigator/content/navigator.xul Main browser window
    chrome://browser/content/pageinfo/pageInfo.xul chrome://navigator/content/pageinfo/pageInfo.xul Page Info window
    chrome://browser/content/preferences/permissions.xul chrome://communicator/content/permis...onsManager.xul Permissions Manager dialog
    <caption>URL's added in 2.1</caption>
    URL in Firefox URL in Seamonkey
    chrome://browser/content/bookmarks/bookmarksPanel.xul chrome://communicator/content/bookmarks/bm-panel.xul
    chrome://browser/content/places/places.xul chrome://communicator/content/bookma...rksManager.xul
    Thunderbird uses mostly the same chrome URLs for overlaying as SeaMonkey. There are exceptions, but these are few and far between.
  •  
  • SeaMonkey also uses different ids for the menu items. Some important menu ids are listed below, menu ids are based on Firefox 3 source code:

    Menu id in Firefox Menu id in SeaMonkey 1.x and 2.0
    SeaMonkey 2.1 Overlays
    menu_FilePopup menu_FilePopup menu_FilePopup File menu popup
    menu_EditPopup menu_Edit_Popup menu_EditPopup Edit menu popup
    menu_viewPopup menu_View_Popup menu_View_Popup View menu popup
    - goPopup goPopup Go menu popup
    placesPopup - - History menu popup
    bookmarksMenuPopup menu_BookmarksPopup menu_BookmarksPopup Bookmarks menu popup
    menu_ToolsPopup taskPopup taskPopup Tools menu popup
    - windowPopup windowPopup Window menu popup
    menu_HelpPopup helpPopup helpPopup Help menu popup

URLbar Icons

To to display a button with a menupopup in the urlbar-icons for both Firefox and SeaMonkey 2.0, use this code:

    <hbox id="urlbar-icons">
        <image popup="myExt-menu"/>
    </hbox>
     <window id="main-window">
        <menupopup id="myExt-menu">
            <menuitem label="menuitem"/>
            <menuitem label="menuitem"/>
        </menupopup>
    </window>

Instead of

    <hbox id="urlbar-icons">
        <button type="menu">
            <menupopup>
                <menuitem label="menuitem"/>
                <menuitem label="menuitem"/>
                <menuitem label="menuitem"/>
            </menupopup>
        </button>
   </hbox>

Technical Note: The code that opens the URL history popup just looks for any menupopup, so it goes wrong if you add your own. Ordinary popups are fine of course.

The Statusbar

In Firefox 3 new vbox has been added, called "browser-bottombox", which encloses the find bar and status bar at the bottom of the browser window. Although this doesn't affect the appearance of the display, it may affect your extension if it overlays chrome relative to these elements.

For example, if you overlay some chrome before the status bar, like this:

<vbox id="browser-bottombox">
  <something insertbefore="status-bar" />
</vbox>

Use the following technique to make your overlay work on both SeaMonkey 2 and Firefox 3:

<window id="main-window">
  <vbox id="browser-bottombox" insertbefore="status-bar">
    <something insertbefore="status-bar" />
  </vbox>
</window>

Thunderbird 3

gFolderDisplay API

SeaMonkey 2.0 only supports a reduced set of methods:

  • selectedCount
  • selectedMessage
  • selectedMessageIsFeed
  • selectedMessageIsImap
  • selectedMessageIsNews
  • selectedMessageIsExternal
  • selectedIndices
  • selectedMessages
  • selectedMessageUris
  • messageDisplay

gMessageDisplay API

SeaMonkey 2.0 only supports a reduced set of methods:

  • displayedMessage
  • visible

Tags (3)

  • Extensions
  • Add-ons
  • SeaMonkey
Contributors to this page: Sevenspade, Philip Chee, Archaeopteryx, wicked, Editmonkey, KaiRo, Iav
Last updated by: wicked,