• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
Add-ons
  1. MDN
  2. Mozilla
  3. Add-ons
  4. Extensions support in SeaMonkey 2

Extensions support in SeaMonkey 2

In This Article
    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
    6. JavaScript Tweaks
    7. Multi-browser compatibility
      1. In JavaScript code
      2. In manifest file

Starting with SeaMonkey 2 Alpha 1 SeaMonkey supports 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 extension's 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.*</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
     
    URLs added in 2.1
    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 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 a 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

JavaScript Tweaks

Firefox supports some shorthand in various places. These are so commonly available that developers often forget that they are not built-ins. SeaMonkey on the other hand defaults to not support them so they either need to be expanded to their proper forms or matching constants/variables need to be defined in custom code.

Shorthand Expansion
Cc Components.classes
Ci Components.interfaces
Cr Components.results
Cu Components.utils

Multi-browser compatibility

To make an extension compatible with SeaMonkey as well as Firefox/Thunderbird, you may need to do different things depending on which application is running the extension.

In JavaScript code

You can use the following technique to detect the application:

const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
const THUNDERBIRD_ID = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
const SEAMONKEY_ID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
                        .getService(Components.interfaces.nsIXULAppInfo);
if(appInfo.ID == FIREFOX_ID) {
  // running under Firefox
} else if(appInfo.ID == THUNDERBIRD_ID) {
  // running under Thunderbird
} else if(appInfo.ID == SEAMONKEY_ID) {
  // running under SeaMonkey
} else {
  // another app
}

See Using nsIXULAppInfo for more details.

In manifest file

SeaMonkey uses different overlays than other applications. You can use the application flag to select which overlay should be used with which application:

overlay chrome://browser/content/browser.xul chrome://myaddon/content/ffOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
overlay chrome://navigator/content/navigator.xul chrome://myaddon/content/smOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}

Document Tags and Contributors

Tags: 
  • Add-ons
  • CodingScripting
  • Extensions
  • JavaScript
  • SeaMonkey
  • thunderbird
  • URL
 Contributors to this page: wbamberg, dkocho4, ChrisAntaki, VeridianDynamics, jhatlak, Hb, Editmonkey, wicked, Iav, Philip Chee, Sevenspade, KaiRo, Aryx
 Last updated by: wbamberg, Jan 15, 2016, 10:53:25 AM
See also
  1. WebExtensions
  2. Getting started
    1. Prerequisites
    2. Anatomy of a WebExtension
    3. Packaging and Installation
    4. Walkthrough
    5. Examples
  3. Guides
    1. Content scripts
    2. Porting from Google Chrome
    3. Match patterns
    4. Debugging
    5. Chrome incompatibilities
  4. JavaScript APIs
    1. alarms
    2. bookmarks
    3. browserAction
    4. contextMenus
    5. cookies
    6. events
    7. extension
    8. extensionTypes
    9. i18n
    10. idle
    11. notifications
    12. pageAction
    13. runtime
    14. storage
    15. tabs
    16. webNavigation
    17. webRequest
    18. windows
  5. Manifest keys
    1. applications
    2. background
    3. browser_action
    4. content_scripts
    5. default_locale
    6. description
    7. icons
    8. manifest_version
    9. name
    10. page action
    11. permissions
    12. version
    13. web_accessible_resources
  6. Add-on SDK
  7. Getting started
    1. Installation
    2. Getting started
    3. Troubleshooting
  8. High-Level APIs
    1. addon-page
    2. base64
    3. clipboard
    4. context-menu
    5. hotkeys
    6. indexed-db
    7. l10n
    8. notifications
    9. page-mod
    10. page-worker
    11. panel
    12. passwords
    13. private-browsing
    14. querystring
    15. request
    16. selection
    17. self
    18. simple-prefs
    19. simple-storage
    20. system
    21. tabs
    22. timers
    23. ui
    24. url
    25. widget
    26. windows
  9. Low-Level APIs
    1. /loader
    2. chrome
    3. console/plain-text
    4. console/traceback
    5. content/content
    6. content/loader
    7. content/mod
    8. content/symbiont
    9. content/worker
    10. core/heritage
    11. core/namespace
    12. core/promise
    13. dev/panel
    14. event/core
    15. event/target
    16. frame/hidden-frame
    17. frame/utils
    18. fs/path
    19. io/byte-streams
    20. io/file
    21. io/text-streams
    22. lang/functional
    23. lang/type
    24. loader/cuddlefish
    25. loader/sandbox
    26. net/url
    27. net/xhr
    28. places/bookmarks
    29. places/favicon
    30. places/history
    31. platform/xpcom
    32. preferences/event-target
    33. preferences/service
    34. remote/child
    35. remote/parent
    36. stylesheet/style
    37. stylesheet/utils
    38. system/child_process
    39. system/environment
    40. system/events
    41. system/runtime
    42. system/unload
    43. system/xul-app
    44. tabs/utils
    45. test/assert
    46. test/harness
    47. test/httpd
    48. test/runner
    49. test/utils
    50. ui/button/action
    51. ui/button/toggle
    52. ui/frame
    53. ui/id
    54. ui/sidebar
    55. ui/toolbar
    56. util/array
    57. util/collection
    58. util/deprecate
    59. util/list
    60. util/match-pattern
    61. util/object
    62. util/uuid
    63. window/utils
  10. Firefox for Android
  11. Getting started
    1. Walkthrough
    2. Debugging
    3. Code snippets
  12. APIs
    1. Accounts.jsm
    2. BrowserApp
    3. HelperApps.jsm
    4. Home.jsm
    5. HomeProvider.jsm
    6. JavaAddonManager.jsm
    7. NativeWindow
    8. Notifications.jsm
    9. PageActions.jsm
    10. Prompt.jsm
    11. Snackbars.jsm
    12. Sound.jsm
    13. Tab
  13. Legacy
  14. Restartless extensions
    1. Overview
  15. Overlay extensions
    1. Overview
  16. Themes
  17. Lightweight themes
    1. Overview
  18. Complete themes
    1. Overview
  19. Publishing add-ons
  20. Guides
    1. Signing and distribution overview
    2. Submit an add-on
    3. Review policies
    4. Developer agreement
    5. Featured add-ons
    6. Contact addons.mozilla.org
  21. Community and support
  22. Channels
    1. Add-ons blog
    2. Add-on forums
    3. Stack Overflow
    4. Development newsgroup
    5. IRC Channel