|
@@ -0,0 +1,303 @@
|
|
|
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+
|
|
|
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
+<meta http-equiv="Content-Language" content="en">
|
|
|
+<meta http-equiv="Content-Style-Type" content="text/css">
|
|
|
+<meta http-equiv="Content-Script-Type" content="text/javascript">
|
|
|
+
|
|
|
+<link rel="top" href="../" title="SeaMonkey Project">
|
|
|
+<link rel="up" href="./" title="Development">
|
|
|
+
|
|
|
+<title>Extensions</title>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<h1>SeaMonkey Extensions</h1>
|
|
|
+
|
|
|
+<p>
|
|
|
+SeaMonkey supports toolkit/-style extensions.
|
|
|
+</p>
|
|
|
+
|
|
|
+<h2 id="The_Basics">The Basics</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+To support SeaMonkey 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:
|
|
|
+</p>
|
|
|
+
|
|
|
+<pre><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></pre>
|
|
|
+
|
|
|
+<p>
|
|
|
+The install.js is not supported any more and should be removed.
|
|
|
+</p>
|
|
|
+
|
|
|
+<h2 id="Differences">Differences as compared to other toolkit/-based
|
|
|
+applications</h2>
|
|
|
+
|
|
|
+<ul>
|
|
|
+ <li>
|
|
|
+ <p>
|
|
|
+ You need to overlay/open different chrome URLs as compared to Firefox. Some
|
|
|
+ URLs are listed below:
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <table style="height: 69px; width: 100%;">
|
|
|
+ <tbody>
|
|
|
+ <tr style="background-color: rgb(204, 255, 204);">
|
|
|
+ <td>URL in Firefox</td>
|
|
|
+ <td>URL in SeaMonkey</td>
|
|
|
+ <td>Overlays</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a class="external" rel="freelink">chrome://browser/content/browser.xul</a></td>
|
|
|
+ <td><a class="external" rel="freelink">chrome://navigator/content/navigator.xul</a></td>
|
|
|
+ <td>Main browser window</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a class="external" rel="freelink">chrome://browser/content/pageinfo/pageInfo.xul</a></td>
|
|
|
+ <td><a class="external" rel="freelink">chrome://navigator/content/pageinfo/pageInfo.xul</a></td>
|
|
|
+ <td>Page Info window</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a class="external" rel="freelink">chrome://browser/content/bookmarks/bookmarksPanel.xul</a></td>
|
|
|
+ <td><a class="external" rel="freelink">chrome://communicator/content/bookmarks/bookmarksPanel.xul</a></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a class="external" rel="freelink">chrome://browser/content/places/places.xul</a></td>
|
|
|
+ <td><a class="external" rel="freelink">chrome://communicator/content/places/places.xul</a></td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ Old versions of <strong>Thunderbird</strong> use mostly the same chrome URLs
|
|
|
+ for overlaying as SeaMonkey. There are exceptions, but these are few and far
|
|
|
+ between.
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <p>
|
|
|
+ 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:
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <table style="height: 223px; width: 800px;">
|
|
|
+ <tbody>
|
|
|
+ <tr style="background-color: rgb(204, 255, 255);">
|
|
|
+ <td><strong>Menu id in Firefox</strong></td>
|
|
|
+ <td><strong>Menu id in SeaMonkey</strong></td>
|
|
|
+ <td><strong>Overlays</strong></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>menu_FilePopup</td>
|
|
|
+ <td>menu_FilePopup</td>
|
|
|
+ <td>File menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>menu_EditPopup</td>
|
|
|
+ <td>menu_EditPopup</td>
|
|
|
+ <td>Edit menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>menu_viewPopup</td>
|
|
|
+ <td>menu_View_Popup</td>
|
|
|
+ <td>View menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>goPopup</td>
|
|
|
+ <td>goPopup</td>
|
|
|
+ <td>Go menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>placesPopupset</td>
|
|
|
+ <td>placesPopupset</td>
|
|
|
+ <td>History menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>bookmarksMenuPopup</td>
|
|
|
+ <td>bookmarksMenuPopup</td>
|
|
|
+ <td>Bookmarks menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>menu_ToolsPopup</td>
|
|
|
+ <td>taskPopup</td>
|
|
|
+ <td>Tools menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>windowPopup</td>
|
|
|
+ <td>windowPopup</td>
|
|
|
+ <td>Window menu popup</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>-</td>
|
|
|
+ <td>helpPopup</td>
|
|
|
+ <td>Help menu popup</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+<h2 id="URLbar_Icons">URLbar Icons</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+To display a button with a menupopup in the urlbar-icons for both Firefox and
|
|
|
+SeaMonkey, use this code:
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>
|
|
|
+ <code>
|
|
|
+<hbox id="urlbar-icons"><br>
|
|
|
+ <image popup="myExt-menu"/><br>
|
|
|
+</hbox><br>
|
|
|
+<window id="main-window"><br>
|
|
|
+ <menupopup id="myExt-menu"><br>
|
|
|
+ <menuitem label="menuitem"/><br>
|
|
|
+ <menuitem label="menuitem"/><br>
|
|
|
+ <menuitem label="menuitem"/><br>
|
|
|
+ </menupopup><br>
|
|
|
+</window>
|
|
|
+ </code>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>Instead of</p>
|
|
|
+
|
|
|
+<p>
|
|
|
+ <code>
|
|
|
+<hbox id="urlbar-icons"><br>
|
|
|
+ <button type="menu"><br>
|
|
|
+ <menupopup><br>
|
|
|
+ <menuitem label="menuitem"/><br>
|
|
|
+ <menuitem label="menuitem"/><br>
|
|
|
+ <menuitem label="menuitem"/><br>
|
|
|
+ </menupopup><br>
|
|
|
+ </button><br>
|
|
|
+</hbox>
|
|
|
+ </code>
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>
|
|
|
+<strong>Technical Note:</strong> 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.
|
|
|
+</p>
|
|
|
+
|
|
|
+<h2 id="The_Statusbar">The Statusbar</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+In Firefox a new <code>vbox</code> 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.
|
|
|
+</p>
|
|
|
+
|
|
|
+<p>
|
|
|
+For example, if you overlay some chrome before the status bar, like this:
|
|
|
+</p>
|
|
|
+
|
|
|
+<pre>
|
|
|
+<vbox id="browser-bottombox">
|
|
|
+ <something insertbefore="status-bar" />
|
|
|
+</vbox>
|
|
|
+</pre>
|
|
|
+
|
|
|
+<p>
|
|
|
+Use the following technique to make your overlay work on both SeaMonkey and
|
|
|
+Firefox (pre-57):
|
|
|
+</p>
|
|
|
+
|
|
|
+<pre>
|
|
|
+<window id="main-window">
|
|
|
+ <vbox id="browser-bottombox" insertbefore="status-bar">
|
|
|
+ <something insertbefore="status-bar" />
|
|
|
+ </vbox>
|
|
|
+</window>
|
|
|
+</pre>
|
|
|
+
|
|
|
+<h2 id="Thunderbird_3">Thunderbird 3</h2>
|
|
|
+
|
|
|
+<h3 id="gFolderDisplay_API">gFolderDisplay API</h3>
|
|
|
+
|
|
|
+<p>SeaMonkey only supports a reduced set of methods:</p>
|
|
|
+
|
|
|
+<ul>
|
|
|
+ <li>selectedCount</li>
|
|
|
+ <li>selectedMessage</li>
|
|
|
+ <li>selectedMessageUri</li>
|
|
|
+ <li>selectedMessageIsFeed</li>
|
|
|
+ <li>selectedMessageIsImap</li>
|
|
|
+ <li>selectedMessageIsNews</li>
|
|
|
+ <li>selectedMessageIsExternal</li>
|
|
|
+ <li>selectedIndices</li>
|
|
|
+ <li>selectedMessages</li>
|
|
|
+ <li>selectedMessageUris</li>
|
|
|
+ <li>canArchiveSelectedMessages</li>
|
|
|
+ <li>displayFolder</li>
|
|
|
+ <li>focusedPane</li>
|
|
|
+ <li>messageDisplay</li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+<h3 id="gMessageDisplay_API">gMessageDisplay API</h3>
|
|
|
+
|
|
|
+<p>SeaMonkey only supports a reduced set of methods:</p>
|
|
|
+
|
|
|
+<ul>
|
|
|
+ <li>displayedMessage</li>
|
|
|
+ <li>isDummy</li>
|
|
|
+ <li>visible</li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+<h2 id="Multi-browser_compatibility">Multi-browser compatibility</h2>
|
|
|
+
|
|
|
+<p>
|
|
|
+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.
|
|
|
+</p>
|
|
|
+
|
|
|
+<h3 id="In_JavaScript_code">In JavaScript code</h3>
|
|
|
+
|
|
|
+<p>
|
|
|
+You can use the following technique to detect the application:
|
|
|
+</p>
|
|
|
+
|
|
|
+<pre>
|
|
|
+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
|
|
|
+}
|
|
|
+</pre>
|
|
|
+
|
|
|
+<h3 id="In_manifest_file">In manifest file</h3>
|
|
|
+
|
|
|
+<p>
|
|
|
+SeaMonkey uses different overlays than other applications. You can use the
|
|
|
+application flag to select which overlay should be used with which application:
|
|
|
+</p>
|
|
|
+
|
|
|
+<pre>
|
|
|
+<code>
|
|
|
+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}
|
|
|
+</code>
|
|
|
+</pre>
|
|
|
+
|
|
|
+</body>
|
|
|
+</html>
|