Search completed in 1.32 seconds.
chrome.manifest - Archive of obsolete content
Copy the following text and paste it into a text file, then save that file as "
chrome.manifest": skin global My_Theme jar:chrome/My_Theme.jar!/global/ skin mozapps My_Theme jar:chrome/My_Theme.jar!/mozapps/ skin messenger My_Theme jar:chrome/My_Theme.jar!/messenger/ skin messenger-newsblog My_Theme jar:chrome/My_Theme.jar!/messenger-newsblog/ skin communicator My_Theme jar:chrome/My_Theme.jar!/communicator/ skin help My_Theme jar:chrome/My_Theme.jar!/help/ skin navigator My_Theme jar:chrome/My_Theme.jar!/navigator/ skin editor My_Theme jar:chrome/My_Theme.jar!/editor/ ...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
to organize your extension's source files. The folder can be wherever you want, but for the purposes of this guide, we'll assume it's at C:\extensions\helloworld . Create folders and files in your work folder as shown in Figure 4. The purpose of each file created during Phase 1 is explained in Table 2. ...
... | +---content clock.js clock.xul overlay.xul Table 2: How files are used in Phase 1 FIXME: Make the table cleaner File name Role install.rdf Called the install manifest, this gives basic information about the extension, and is required in order for the extension to be installed in Firefox..
chrome.manifest This is the chrome manifest described in the earlier section. Registers packages and invokes cross-package overlays. content/overlay.xul XUL file that will be overlaid on the Firefox browser window, adding buttons, menu items, etc. content/clock.xul content/clock.js The XUL to display a clock in the window, and the JavaScript to control its operati...
...Here, helloworld is a package name, and content/ is a relative path to ...
...And 12 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
files, for example Services.jsm, you'll do so via privileged JavaScript code like this: Components.utils.import("resource://gre/modules/Services.jsm"); From here on out, it is assumed you've imported Services.jsm somewhere at the top of whatever file you're in and will be using it in all code examples. ...
...will also assume that you know how to properly add instructions to your add-on's
chrome.manifest to add and remove resource, chrome, locale, & etc. mappings, so that you can access your files with custom paths such as: resource://myAddon/filename.ext chrome://myAddon/content/filename.ext Step 2: No more resource:// URIs for files internal to your bundle Unfortunately, resource mappings in your
chrome.manifest were not usable in restartless add-ons until Mozilla finally fixed this bug in Firefox 38, which looked bad, but only because Mozilla is still using resource:// URIs internally and in examples. Resource mappings for files in the mozilla distribution, such as Services.jsm (above), will continue to work. ...
...It's a great way to modularize your code that's been available since Firefox 3. You can use chrome:// URIs with "Components.utils.import()" just fine; in fact you've been able to since Firefox 4. ...
...And 5 more matches
Structure of an installable bundle - Archive of obsolete content
Path from the root of the bundle Description Version information /install.rdf Extension/Theme Install Manifest /application.ini Application Launch Manifest /bootstrap.js The bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). Note that other files and directories (e.g. ...
... /application.ini Application Launch Manifest /bootstrap.js The bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). Note that other files and directories (e.g.
chrome.manifest, components, defaults) in bootstrapped extensions are not processed by a supporting application. ...
...=1.8) /icon.png Extension icon, for display in the Add-ons Manager, 32px x 32px (>=1.9.2) /icon64.png Extension icon, for display in the Add-ons Manager, 64px x 64px (>=2.0) /options.xul Extension options, for display in the Add-ons Manager (>=7.0) ... Additional resources (such as chrome:// or resource:// providers can be registered in the
chrome.manifest) Application-specific /searchplugins/*.src Sherlock search plugins Firefox 1.5 and greater. /searchplugins/*.xml MozSearch and OpenSearch plugins Firefox 2 and greater /dictionaries/*.{aff|dic} Myspell dictionaries Firefox 2 and greater Of course, an extension need not (and normally won't) have all of these directories. Themes are ...
...And 5 more matches
Bootstrapped extensions - Archive of obsolete content
ger window. When the application is started up, if the extension is enabled and compatible with the application. Some examples of when the shutdown() function may be called: When the extension is uninstalled, if it's currently enabled. When the extension becomes disabled. When the user quits the application, if the extension is enabled. ...
... extension is enabled and compatible with the application. Some examples of when the shutdown() function may be called: When the extension is uninstalled, if it's currently enabled. When the extension becomes disabled. When the user quits the application, if the extension is enabled. ...
...tension is enabled. Notes on modifying the application user interface
chrome.manifest in bootstrapped add-ons You can use a
chrome.manifest file in bootstrapped add-ons to: Make your add-on's content available via a chrome:// URL (using the content, locale, and skin instructions in the manifest). Replace existing chrome:// URIs with your content (using the override instruction). Not all
chrome.manifest instructions are supported in bootstrapped add-ons, for example you still cannot register XUL Overlays from a bootstrapped add-on. See the
chrome.manifest documentation for details. In Firefox 10 and later the
chrome.manifest file located in the root of the add-on's XPI (i.e. a sibling of the install.rdf) is loaded automatically. In Firefox 8 and 9 you had to load/unload the manifest manually us...
...And 4 more matches
The Essentials of an Extension - Archive of obsolete content
ox 11, add-ons will default to compatible and Firefox will mostly ignore the version range. Testing your add-ons with every Firefox version is always recommended, though. This is the information Firefox and other Mozilla applications need to install an add-on. Any errors or missing information will cause the installation process to fail, or the extension to be installed in a disabled state. The
chrome.manifest File Chrome is the set of user interface elements of the application window that are outside of a window's content area. Toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. Taken from Chrome Registration. In other words, the chrome is everything you see in Firefox. All Firefox windows can be seen as having two parts: (...
... area, like the one that displays web pages in a Firefox tab. Windows like the Downloads window are pure chrome. Most of the code for an extension resides in the chrome folder, just like in the Hello World example. As we saw in the directory structure of the unpacked extension, the chrome is composed of 3 sections: content, locale and skin. The 3 are necessary for most extensions. If we open the
chrome.manifest file (again, any text editor will do), we see that the same 3 sections are mentioned: content xulschoolhello content/ skin xulschoolhello classic/1.0 skin/ locale xulschoolhello en-US locale/ The
chrome.manifest file tells Firefox where to look for chrome files. The text is spaced to look like a table, but that is not necessary. The parser ignores repeated sp...
...ird value to specify what locale or what skin they are extending. There can be multiple skin and locale entries relating to different skins and locales. The most common case is having one skin entry for the global skin, classic/1.0, and multiple locale entries, one for each translation. Finally, the location is specified. There are some additional options that can be included in the entries of a
chrome.manifest file. They are documented in the Chrome Registration page. Notably, we can have entries that are OS-specific. This is important because the appearance of the browser is very different for each operating system. If our extension needed to look differently on different systems, we could change the manifest file so that it looks like this: content xulschoolhello content/ skin ...
...And 3 more matches
Complete - Archive of obsolete content
lcustom. It uses this name as the default file name throughout. Where you see a URL in the code with no file name, the application uses this default file name and an extension appropriate for the type of file expected. The extension is supplied as a XPI, which is compressed to reduce download times. The XPI contains: install.rdf Information about the extension
chrome.manifest Registration data for Firefox etc. install.js Installation script for SeaMonkey chrome Directory containing the extension code chrome/allcustom.jar The extension jar defaults/preferences Directory containing a preferences file Inside the jar there are three directories: content ...
...led jar To use disk space efficiently on the end user's computer, the three directories (content, locale, skin) are packed in a jar file. It is normally uncompressed, trading off some disk space for speed. This jar file will be installed as-is on the end user's computer, and unpacked at run-time by the application. To tell the application that the files it needs are in a jar, there are changes to
chrome.manifest (for Firefox etc.) and to install.js (for SeaMonkey). For example,
chrome.manifest originally had: content custombutton chrome/ Now it has: content allcustom jar:chrome/allcustom.jar!/content/allcustom/ You can see the other changes if you unpack the XPI. Languages Extensions can be installed by users who have different language and regional preferences. A combination of language and regional pre...
...press button 1 you see an message in English or French, depending on your application's locale. This is how it happens: For example, if your locale is fr-FR, it loads: locale/fr-FR/allcustom/allcustom.dtd from inside the jar file. When you restart after installing the extension, the locales en-US and fr-FR are both registered for the component allcustom. You can see the registration details in
chrome.manifest (Firefox, etc.) or in installed-chrome.txt and chrome.rdf (SeaMonkey). When the XUL file, allcustom.xul is loaded, the DOCTYPE declaration near the top loads a DTD from chrome://allcustom/locale/. The application's chrome registry converts this URL to the correct DTD file for the locale you are using. The XUL toolbarbutton tag contains an entity &allcustom.alert.1;. The DTD resolves this into...
...And 3 more matches
XPCOM changes in Gecko 2.0
ome is registered. In fact, the same chrome manifest file will be used to register components. All existing XPCOM components will need to be updated to support this. However, it's very easy to do, and you can actually support both types of registration for backward compatibility. Component manifests All component registration is now handled through manifest files. For extensions, this is the same
chrome.manifest currently used to register chrome. XPT files The path of any XPT files must be listed explicitly in a manifest using an interfaces directive: interfaces components/mycomponent.xpt JavaScript components The registration information for JavaScript components is no longer located in the component itself; instead, it's located in the manifest. The component is loaded only when the XPCOM component man...
.... XPT files The path of any XPT files must be listed explicitly in a manifest using an interfaces directive: interfaces components/mycomponent.xpt JavaScript components The registration information for JavaScript components is no longer located in the component itself; instead, it's located in the manifest. The component is loaded only when the XPCOM component manager needs to create a component.
chrome.manifest: # The {classID} here must match the classID in mycomponent.js component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js contract @foobar/mycomponent;1 {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} category profile-after-change MyComponent @foobar/mycomponent;1 The JavaScript code no longer exports a NSGetModule() function. It now must export a NSGetFactory() function, which accepts a ...
... MyComponent @foobar/mycomponent;1 The JavaScript code no longer exports a NSGetModule() function. It now must export a NSGetFactory() function, which accepts a class ID (CID) as a parameter. For example, in your component's JavaScript code : Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); function myComponent() { } myComponent.prototype = { // this must match whatever is in
chrome.manifest! classID: Components.ID("{e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8}"), QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIMyComponent]), /* nsIMyComponent implementation goes here */ ... }; // The following line is what XPCOM uses to create components. Each component prototype // must have a .classID which is used to create it. const NSGetFactory = XPCOMUtils.generateNSGetFact...
...And 3 more matches
Getting started with XULRunner - Archive of obsolete content
, "why" and "how" parts of building a XULRunner application. On Windows, I created the root in a new c:\program files\myapp folder, but you can create it wherever you like, using whatever OS you like. The same application structure is used on Windows, Mac and Linux. Here is the subfolder structure: + myapp/ | +-+ chrome/ | | | +-+ content/ | | | | | +-- main.xul | | | | | +-- main.js | | | +--
chrome.manifest | +-+ defaults/ | | | +-+ preferences/ | | | +-- prefs.js | +-- application.ini | +--
chrome.manifest Notice that there are 5 files in the folder structure: application.ini,
chrome.manifest (2), prefs.js, and main.xul. The /chrome/
chrome.manifest file is optional, but might be useful for backward compatibility. See the note below. For more details on the structure of installable bundles i...
...ini | +--
chrome.manifest Notice that there are 5 files in the folder structure: application.ini,
chrome.manifest (2), prefs.js, and main.xul. The /chrome/
chrome.manifest file is optional, but might be useful for backward compatibility. See the note below. For more details on the structure of installable bundles in general see: Structure of an installable bundle. Note: In XULRunner 2.0, the
chrome.manifest is now used to register XPCOM components in addition to its previous uses. Part of this change means the /chrome/
chrome.manifest is no longer considered the "root" manifest. XULRunner will not check that folder location for a root-level
chrome.manifest. You need to move your existing
chrome.manifest to the application root folder, remembering to update the relative paths within the file. You coul...
... Step 4: Set up application.ini The application.ini file acts as the XULRunner entry point for your application. It specifies how your application intends to use the XULRunner platform as well as configure some information that XULRunner uses to run your application. ...
...And 2 more matches
Building a Theme - Archive of obsolete content
a Skin for Firefox. Note: Firefox for Mac OS X has changed some directories so the guide may be obsolete. Setting up the Development Environment Themes and extensions are packaged and distributed in ZIP files or Bundles, with the XPI (pronounced "zippy") file extension. An example of the content within a typical XPI file for a theme: example.xpi: /install.rdf /
chrome.manifest /preview.png /icon.png /chrome/ browser/ communicator/ global/ mozapps/ We'll want to create a file structure similar to the one above for our tutorial, so let's begin by creating a folder for your theme somewhere on your hard disk (e.g. C:\themes\my_theme\ or ~/themes/...
... browser/ communicator/ global/ mozapps/ We'll want to create a file structure similar to the one above for our tutorial, so let's begin by creating a folder for your theme somewhere on your hard disk (e.g. C:\themes\my_theme\ or ~/themes/my_theme/). Inside your new theme folder, create two new empty text files, one called
chrome.manifest and the other called install.rdf. The file preview.png is shown as a preview of the theme in the themes panel of the add-ons window. The file icon.png is used as an icon in the same panel. We'll leave both of them out for now, unless you have something picked out that you want to use. The remaining directories will be extracted from the default theme. First, you'll want to create a directory som...
...he files we will be needing from the browser/omni.ja archive are located under chrome/browser/skin/classic. Copy the contents of the following directories to their respective folders. This gives us a base set of styles to work with. browser to chrome/browser/ communicator to chrome/communicator/ You should end up with this directory structure: <ext path>/ /install.rdf /
chrome.manifest /chrome/ browser/ communicator/ global/ mozapps/ After this, it would be a good idea to read the article Setting up extension development environment and follow the directions there. It's especially important to install the DOM Inspector, which we'll be using in later steps. Create the Install Manifest Open the fi...
...And 2 more matches
Signing an XPI - Archive of obsolete content
I signed archives because it sorts the directory entries alphabetically, and Mozilla requires the first entry to be META-INF/zigbert.rsa. C:\Projects\CodeSigning\> md signed C:\Projects\CodeSigning\> copy C:\Projects\fsb\fsb.xpi signed 1 file(s) copied. C:\Projects\CodeSigning\> cd signed C:\Projects\CodeSigning\signed> unzip fsb.xpi Archive: fsb.xpi creating: chrome/ inflating:
chrome.manifest inflating: chrome/fsb.jar inflating: install.rdf C:\Projects\CodeSigning\signed> del fsb.xpi C:\Projects\CodeSigning\signed> cd .. Sign XPI C:\Projects\CodeSigning\> signtool -d . -k myTestCert -p "password" signed/ using certificate directory: . Generating signed//META-INF/manifest.mf file.. --> chrome/fsb.jar -->
chrome.manifest --> install.rdf Generating zigbert.sf file.. tree "signed...
... first, then add the remaining files. C:\Projects\Certs\> cd signed C:\Projects\CodeSigning\signed\> zip fsb.xpi META-INF/zigbert.rsa adding: META-INF/zigbert.rsa (deflated 35%) C:\Projects\CodeSigning\signed> zip -r -D fsb.xpi * -x META-INF/zigbert.rsa adding: META-INF/manifest.mf (deflated 37%) adding: META-INF/zigbert.sf (deflated 40%) adding: chrome/fsb.jar (deflated 74%) adding:
chrome.manifest (deflated 69%) adding: install.rdf (deflated 62%) Test your certificate To test your certificate, install it into your browser, and attempt to load the signed extension by following these steps: 1. Temporarily install the Test Certificate Authority into your Mozilla browser Rename the x509.cacert file generated earlier to x509.cert Import it into Mozilla Firefox as a Software Developer Ce...
...f file.. tree "test" signed successfully Incorporating signing into your build process You may want to incorporate these steps into your existing build process. I have a build.bat file that automates the creation of the jar and xpi files. This example is using the CygWin bin/zip.exe tool. build.bat is placed in the extension's root folder. E.g. /dev/fsb/build.bat /dev/fsb/install.rdf /dev/fsb/
chrome.manifest /dev/fsb/chrome/ /dev/fsb/chrome/content/ /dev/fsb/chrome/locale/ /dev/fsb/chrome/skin/ Here it is with the code-signing steps included: @echo off set x=%cd% echo Building %x%.xpi ... echo Started at %DATE% %TIME% > %x%\build.log md build\chrome cd chrome zip -r -0 "%x%.jar" * >> %x%\build.log move "%x%.jar" ..\build\chrome >> %x%\build.log cd .. copy install.rdf build >> %x%\build.lo...
...b/chrome/ /dev/fsb/chrome/content/ /dev/fsb/chrome/locale/ /dev/fsb/chrome/skin/ Here it is with the code-signing steps included: @echo off set x=%cd% echo Building %x%.xpi ... echo Started at %DATE% %TIME% > %x%\build.log md build\chrome cd chrome zip -r -0 "%x%.jar" * >> %x%\build.log move "%x%.jar" ..\build\chrome >> %x%\build.log cd .. copy install.rdf build >> %x%\build.log copy
chrome.manifest build >>%x%\build.log signtool.exe -d C:\Projects\CodeSigning -k "Code Signing (Certum)" -p "password" build/ >> %x%\build.log cd build zip "%x%.xpi" META-INF/zigbert.rsa >> %x%\build.log zip -r -D "%x%.xpi" * -x META-INF/zigbert.rsa >> %x%\build.log rem copy "%x%.xpi" ..\..\..\http\fsb.xpi >> %x%\build.log move "%x%.xpi" ..\ >> %x%\build.log cd .. rd build /s/q echo Done. Make sure to ...
Creating a Firefox sidebar extension - Archive of obsolete content
The chrome manifest creates a lookup for all the resource types used by the extension. The manifest also tells Firefox that the extension has an overlay that needs to be merged into the browser. For more information on chrome manifests and the properties they support, see the Chrome Manifest reference. The manifest used in this extension is listed in Example 6. Exampl...
... chrome manifest file. The chrome manifest creates a lookup for all the resource types used by the extension. The manifest also tells Firefox that the extension has an overlay that needs to be merged into the browser. For more information on chrome manifests and the properties they support, see the Chrome Manifest reference. The manifest used in this extension is listed in Example 6. Example 6.
chrome.manifest content emptysidebar chrome/content/ locale emptysidebar en-US chrome/locale/ skin emptysidebar classic/1.0 chrome/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxOverlay.xul Test While you're developing your sidebar, you will need to test it frequently from Firefox. There is a simple way to do this. First, we need to tell Firefox about your extension.
..., locale and skin folders are packed into emptysidebar.jar, which should be created in the chrome folder. On unix systems: ~/src/emptysidebar$ cd chrome ~/src/emptysidebar/chrome$ zip -r emptysidebar.jar content/ locale/ On Windows systems, use a ZIP tool to create emptysidebar.zip and then rename to emptysidebar.jar. Since we are packaging the extension with a JAR file, we need to update the
chrome.manifest file to take to JAR file into consideration: Example 7.
chrome.manifest content emptysidebar jar:chrome/emptysidebar.jar!/content/ locale emptysidebar en-US jar:chrome/emptysidebar.jar!/locale/ skin emptysidebar classic/1.0 jar:chrome/emptysidebar.jar!/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxOverlay.xul Finally, create the XPI file. This i...
...jar!/locale/ skin emptysidebar classic/1.0 jar:chrome/emptysidebar.jar!/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxOverlay.xul Finally, create the XPI file. This is a ZIP file containing the JAR file in the chrome folder and the manifest files. On unix systems: ~/src/emptysidebar/chrome$ cd .. ~/src/emptysidebar$ zip emptysidebar.xpi install.rdf
chrome.manifest chrome/emptysidebar.jar Open Firefox and browse to the folder containing emptysidebar.xpi. Click on the file and the Extension installation window pops up. After a restart of Firefox, the sidebar is installed. You can download the empty sidebar project to use as a basis for your own sidebars. The EmptySidebar extension Resources Code snippets:Sidebar Building an Extension Creating A...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
ch the stylesheet you created to both the overlay file and the Customize Toolbar window. ...
...PI) at the top of the overlay file: <?xml-stylesheet href="chrome://myextension/skin/toolbar-button.css" type="text/css"?> Note: The CSS file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in the
chrome.manifest file. This is very important because the toolbar customization dialog won't work correctly without this. To include the style on your
chrome.manifest file: style chrome://global/content/customizeToolbar.xul chrome://myextension/skin/toolbar-button.css If you are developing for Firefox 1.0, attach it to the Customize Toolbar window (chrome://global/content/customizeToolbar.xul) using skin/contents.rdf. The code looks like this: <?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.or...
...illa:stylesheets"> <li resource="chrome://global/content/customizeToolbar.xul"/> </Seq> <Seq about="chrome://global/content/customizeToolbar.xul"> <li>chrome://myextension/skin/toolbar-button.css</li> </Seq> </RDF> The skin/contents.rdf file is denigrated in developing for later releases of Firefox. Extensions for Firefox/Thunderbird 1.5 and above should instead use something like this in their
chrome.manifest: skin myextension classic/1.0 chrome/skin/ style chrome://global/content/customizeToolbar.xul chrome://myextension/skin/toolbar-button.css ia Take note of the Packaging section in this article; you may need to include .jar references if you are delivering your extension as an .xpi file. Common mistakes This is a list of the most common mistakes made by extension authors, including both sympto...
...le. Common mistakes This is a list of the most common mistakes made by extension authors, including both symptoms and solutions. Problem: The whole set of default buttons is painted on the toolbar or in the Customize Toolbars window, instead of your own icon. Caused by: Malformed or not applied stylesheet. Solution: Check to be sure your stylesheet is correct, make sure your contents.rdf (or
chrome.manifest) is correct, and be sure you didn't forget to apply the stylesheet to customizeToolbar.xul. A list of commonly overlayed windows with toolbars URL Application and affected window(s) Palette id chrome://browser/content/browser.xul Firefox - Main window BrowserToolbarPalette chrome://navigator/content/navigator.xul SeaMonkey 2.0 - Browser window Browse...
How to implement a custom autocomplete search component
const Ci = Components.interfaces; const Cu = Components.utils; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); const CLASS_ID = Components.ID('x753d830-ba1e-11e0-962b-0800200c9a66'); // <- Change this const CLASS_NAME = "Basic AutoComplete"; const CONTRACT_ID = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constr...
... Stops an asynchronous search that is in progress */ stopSearch: function() { }, QueryInterface: XPCOMUtils.generateQI([ Ci.nsIAutoCompleteSearch ]) }; // The following line is what XPCOM uses to create components const NSGetFactory = XPCOMUtils.generateNSGetFactory([ ProviderAutoCompleteSearch ]); Then register your XPCOM component. ...
... const Ci = Components.interfaces; const CLASS_ID = Components.ID("6224daa1-71x2-4d1a-ad90-01ca1c08e323"); // <- Change this const CLASS_NAME = "Simple AutoComplete"; const CONTRACT_ID = "@mozilla.org/autocomplete/search;1?name=simple-autocomplete"; // Implements nsIAutoCompleteResult function SimpleAutoCompleteResult(searchString, searchResu...
... so you need to make the following changes: Add an NSGetFactory() function: function NSGetFactory(cid) { if (cid.toString().toUpperCase() != CLASS_ID.toString().toUpperCase()) { throw Components.results.NS_ERROR_FACTORY_NOT_REGISTERED; } return SimpleAutoCompleteSearchFactory; } You need to explicitly register the component by adding these lines into your
chrome.manifest file: component {6224daa1-71x2-4d1a-ad90-01ca1c08e323} components/.js contract @mozilla.org/autocomplete/search;1?name=simple-autocomplete {6224daa1-71x2-4d1a-ad90-01ca1c08e323} You need to add the following method: getLabelAt: function(index) { return this._results[index]; } to SimpleAutoCompleteResult Use this newly available component in a XUL fil...
nsIComponentManager
A "bootstrapped" chrome manifest supports some of the instructions allowed in a regular chrome manifest, see the Chrome Registration documentation for details. This method was introduced in Gecko 8 to let bootstrapped add-ons provide content at chrome:// URIs. Until Gecko 10 you had to call this method manually from within the add-on's startup() met...
...thod was introduced in Gecko 8 to let bootstrapped add-ons provide content at chrome:// URIs. Until Gecko 10 you had to call this method manually from within the add-on's startup() method (with a matching removeBootstrappedManifestLocation() call in the add-on's shutdown() method). If you're targeting Gecko 10 or higher there should be no need to call this method, since the bootstrapped add-on's
chrome.manifest is loaded automatically now. void addBootstrappedManifestLocation( in interface nsILocalFile aLocation ); Parameters aLocation The directory or XPI from which to load the
chrome.manifest. createInstance() Creates an instance of the class specified by ClassID. Unlike getService, this returns a new instance each time it is called. (See also nsIFactory.createInstance.) void createInstan...
...n nsIIDRef aIID, [iid_is(aIID),retval] out nsQIResult result ); Parameters aContractID The ContractID of the factory that is being requested. aIID The interface type to be returned. result The resulting interface pointer. Exceptions thrown NS_ERROR_FACTORY_NOT_REGISTERED Indicates that the specified class is not registered. ...
... the
chrome.manifest file previously registered with the addBootstrappedManifestLocation() method. See addBootstrappedManifestLocation() for details. void removeBootstrappedManifestLocation( in interface nsILocalFile aLocation ); Parameters Examples Using addBootstrappedManifestLocation in a bootstrapped extension for Firefox 8 and 9: aLocation The directory or XPI to stop reading the
chrome.manifest from. function startup(params, aReason) { if (Services.vc.compare(Services.appinfo.platformVersion, "10.0") < 0) Components.manager.addBootstrappedManifestLocation(params.installPath); } function shutdown(params, aReason) { if (Services.vc.compare(Services.appinfo.platformVersion, "10.0") < 0) Components.manager.removeBootstrappedManifestLocation(params.installPath); } ...
customDBHeaders Preference
ave the string property set correctly. The attaching of the column handler through the ObserverService object is some pretty new stuff, so I was using the addEventListener("select"...) stuff as a backup. Depending on the release you use one, both, or none of the methods may work. ...
...e methods may work. ...
...efile chrome/ content/ superfluous.js superfluous_overlay.xul Here's the Makefile: DEPS:= chrome/ \
chrome.manifest \ chrome/content/ \ chrome/content/superfluous.js \ chrome/content/superfluous_overlay.xul \ install.rdf superfluous.xpi: ${DEPS} zip $@ ${DEPS}
chrome.manifest: content superfluous chrome/content/ overlay chrome://messenger/content/messenger.xul chrome://superfluous/content/superfluous_overlay.xul install.rdf: <?xml version='1.0' encoding='UTF-8'?> <RDF xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:em='http://www.mozilla.org/2004/em-rdf#'> <Description about='urn:mozilla:install-manifest'> <em:id>superfluous@yoursite.com</em:i...
...sion> <em:maxVersion>3.0.0.*</em:maxVersion> </Description> </em:targetApplication> <em:name>superfluous</em:name> <em:description>Test Superfluous Extension</em:description> <em:creator>Garrett Comeaux</em:creator> </Description> </RDF> Build process: [gcomeaux@kyle tbird-ext]$ cd superfluous/ [gcomeaux@kyle superfluous]$ make zip superfluous.xpi chrome/
chrome.manifest chrome/content/ chrome/content/superfluous.js chrome/content/superfluous_overlay.xul install.rdf adding: chrome/ (stored 0%) adding:
chrome.manifest (deflated 44%) adding: chrome/content/ (stored 0%) adding: chrome/content/superfluous.js (deflated 57%) adding: chrome/content/superfluous_overlay.xul (deflated 44%) adding: install.rdf (deflated 50%) End Result Ultimately, you want to...
Inline options - Archive of obsolete content
o find out when the UI is about to be removed. Use this notification to remove event listeners, or any other references that might otherwise be leaked. Locating the options file There are two ways to let the Add-on Manager find your options file: Method 1 Name the file options.xul and put it in the extension's root folder (alongside install.rdf). This method does not require you to create a
chrome.manifest and set it's path. This method does not require you to specify optionsType in install.rdf. Method 2 Use install.rdf to identify the XUL file used for displaying the options. This requires that you register a content path in the
chrome.manifest. You must also specify the optionsType as 2: <em:optionsURL>chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul</em:optionsURL> <em:opti...
...s not require you to specify optionsType in install.rdf. Method 2 Use install.rdf to identify the XUL file used for displaying the options. This requires that you register a content path in the
chrome.manifest. ...
...content/name_of_my_file_to_use_for_inline_opts.xul</em:optionsURL> <em:optionsType>2</em:optionsType> Your
chrome.manifest file should contain the following, otherwise the path chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul will not exist content myaddon ./ This method allows you to maintain compatibility with previous versions of Firefox by adding an override to your
chrome.manifest: ...
Install Manifests - Archive of obsolete content
L A chrome:// URL to an icon to display in the add-ons list. The icon will be displayed at 32x32 in Firefox 3.6 and lower. In Firefox 4.0 and later the icon can be up to 48x48 pixels in size. If this property is not specified, a default icon is used. <em:iconURL>chrome://myext/skin/icon.png</em:iconURL> Note: For the above example to work you will also have to add a skin package line to your
chrome.manifest file. See Chrome Registration#skin. Alternatively you can place your icon in the directory specified in your content package line. Gecko 1.9.2 note Starting in Gecko 1.9.2 (Firefox 3.6), you can also simply include your icon, named icon.png, in the base directory of the add-on. This allows your add-on's icon to be displayed even when the add-on is disabled, or if the manifest is missing an ic...
...ven when the add-on is disabled, or if the manifest is missing an iconURL entry. icon64URL A chrome:// URL to a 64x64 pixel icon to display in the add-on's details view . If this property is not specified, the smaller icon above will be used. <em:icon64URL>chrome://myext/skin/icon64.png</em:icon64URL> Note: For the above example to work you will also have to add a skin package line to your
chrome.manifest file. See Chrome Registration#skin. Alternatively you can place your icon in the directory specified in your content package line. Gecko 2.0 note Starting in Gecko 2.0 (Firefox 4.0), you can also simply include your icon, named icon64.png, in the base directory of the add-on. This allows your add-on's icon to be displayed even when the add-on is disabled, or if the manifest is missing an icon...
...PI's top level. This object has a package property (with a path within the jar file or directory that leads to the location where the contents.rdf file responsible for registering that package is located), a locale property (ditto, but to register the locale) and a skin property (ditto, but to register the theme material). In extensions for Firefox 1.5, this property is no longer necessary: the
chrome.manifest at the top level of the XPI is used to locate chrome to register. If there is no
chrome.manifest, this property is still read by the Add-on Manager and a
chrome.manifest is generated from old-style contents.rdf. Examples <em:file> <Description about="urn:mozilla:extension:file:myext.jar"> <em:package>content/myext/</em:package> <em:locale>locale/myext/</em:locale> <em:skin>skin/cl...
Makefile.mozextension.2 - Archive of obsolete content
real_install: $(CP) chrome/$(PROJECT).jar ~/.mozilla/default/32p27fdr.slt/chrome/ #################################### ###### define CHROME_MANIFEST content $(PROJECT...
...nt $(PROJECT)/locale $(PROJECT)/locale/en-us $(PROJECT)/components/ $(PROJECT)/defaults/ $(PROJECT)/defaults/preferences/ $(PROJECT)/locale/de-de $(PROJECT)/skin make_xpi: $(MKDIR) $(PROJECT)/chrome && \ cd $(PROJECT) && \ $(ZIPPROG) -r chrome/$(PROJECT).jar content locale skin && \ $(ZIPPROG) -r $(PROJECT).xpi
chrome.manifest install.rdf components defaults chrome && cd .. make_files:
chrome.manifest install.rdf overlay.xul overlay.js overlay.dtd $(NOECHO) $(NOOP) make_clean: rm -rf $(PROJECT) # this may be a bit too old ?! Keeping it anyway.. real_install: $(CP) chrome/$(PROJECT).jar ~/.mozilla/default/32p27fdr.slt/chrome/ #################################### ###### define CHROME_MANIFEST content $(PROJECT) content/ overlay chrome://browser/content/browser.xul chrome://$(PROJECT)/c...
...default/32p27fdr.slt/chrome/ #################################### ###### define CHROME_MANIFEST content $(PROJECT) content/ overlay chrome://browser/content/browser.xul chrome://$(PROJECT)/content/overlay.xul locale $(PROJECT) en-US locale/ skin $(PROJECT) classic/1.0 skin/ style chrome://global/content/customizeToolbar.xul chrome://$(PROJECT)/skin/overlay.css endef export CHROME_MANIFEST
chrome.manifest: @echo Generating $(PROJECT)/
chrome.manifest @echo "$$CHROME_MANIFEST" > $(PROJECT)/
chrome.manifest ###### #Firefox {ec8030f7-c20a-464f-9b0e-13a3a9e97384} #Thunderbird {3550f703-e582-4d05-9a08-453d09bdfdc6} #Nvu {136c295a-4a5a-41cf-bf24-5cee526720d5} #Mozilla Suite {86c18b42-e466-45a9-ae7a-9b95ba6f5640} #SeaMonkey {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} #Sunbird {718e30fb-e89b-41dd-9da7-...
Sunbird Theme Tutorial - Archive of obsolete content
paste your identifier between the double-quote characters, replacing the identifier that is there now. Change the next six lines to describe your theme. Ensure that the internal name is a single word. Note: If your theme is for a version of Sunbird later than 0.4, then also change the maxVersion. Save the file. Registering your theme To register your theme, create a plain text file named <tt>
chrome.manifest</tt>. Copy and paste the content from here (just one line): skin calendar testing chrome/calendar/ Change <tt>testing</tt> to your theme's one-word internal name. Save the file. Creating the theme itself To create the theme itself, go to Sunbird's program directory. Note: If you do not know where the program directory is, look at the properties of the shortcut or launcher icon that you use ...
...view.png</tt> in your theme directory. Adding other components Your theme only modifies the calendar component. Sunbird also contains communicator, global, help and mozapps components. To add these to your theme, unpack the file <tt>classic.jar</tt> in Sunbird's <tt>chrome</tt> directory. From the unpacked <tt>skin/classic</tt> directory, copy the extra directories into your theme. In your <tt>
chrome.manifest</tt> file, add lines like this: skin communicator testing chrome/communicator/ skin global testing chrome/global/ skin help testing chrome/help/ skin mozapps testing chrome/mozapps/ replacing <tt>testing</tt> with your theme's one-word internal name as before. To understand the user interface provided by these other components, unpack the other jar files. Packaging your theme You can package...
...into a file. It is usual to turn off compression so that your theme's speed is maximized. Make sure that the tool packs all the directories and files that make up your theme. Name the packed file with the <tt>.jar</tt> extension. For example, when I wrote this article I used this command in my <tt>chrome</tt> directory: zip -0r testing.jar . Go back to your theme directory and edit the file <tt>
chrome.manifest</tt>. Change the line for the calendar component to: skin calendar testing jar:chrome/testing.jar!/calendar/ and make the corresponding change in any other lines that you added. Save the file. Use a jar tool or zip tool to pack the files in your theme directory together with your <tt>.jar</tt> file. It is usual to use maximum compression so that users can download your theme quickly. Make sure ...
Theme changes in Firefox 4 - Archive of obsolete content
: largeicons; } Creating a theme that works for Firefox 4 on Mac OS X Create a new directory (for example, My_Theme). Inside that, create another new directory chrome. Now copy all of the directories from omni.jar mentioned above into it. Then copy all of icon.png, install.rdf and preview.png from <firefox-app-bundle>/Contents/MacOS/extensions/{...} into My_Theme. ...
... Improving your appearance on Windows The new -moz-windows-theme media query lets you determ...
...ructure : /My_Theme/chrome/browser/* /My_Theme/chrome/communicator/* /My_Theme/chrome/global/* /My_Theme/chrome/mozapps/* /My_Theme/
chrome.manifest /My_Theme/icon.png /My_Theme/install.rdf /My_Theme/preview.png Note: For more information (and how to package into a jar) consult Creating a Skin for Firefox which still mostly applies. Most likely you must replace all occurences of classic/1.0 in
chrome.manifest and install.rdf with some other name. Improving your appearance on Windows The new -moz-windows-theme media query lets you determine which Windows theme is currently in use; this lets you make your theme adapt to work well with the Windows environment as it's configured. ...
Chrome registration
What is chrome? Chrome is the set of user interface elements of the application window that are outside the window's content area. Toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. Mozilla locates and reads the root
chrome.manifest file for extensions and themes. Note: With Gecko 1.9.2 and older, Mozilla reads chrome/*.manifest files from applications. Starting with Gecko 2.0, the root
chrome.manifest is the only manifest used; you can add manifest commands to that file to load secondary manifests. Chrome providers A supplier of chrome for a given window type (e.g., for the browser window) is called a chrome provider. The providers work together to supply a complete set of chrome for a particular window, from the i...
...m chrome package names to the physical location of chrome packages on disk. This chrome registry is configurable and persistent, and thus a user can install different chrome providers, and select a preferred skin and locale. This is accomplished through xpinstall and the extension manager. In order to inform the chrome registry of the available chrome, a text manifest is used: this manifest is "
chrome.manifest" in the root of an extension, or theme, or XULRunner application. The plaintext chrome manifests are in a simple line-based format. Each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that line (and prints a warning message in the runtime error console). locale packagename localename path/t...
...l/content/netError.xhtml content inspector jar:inspector.jar!/content/inspector/ Instructions supported in bootstrapped add-ons The following instructions are supported in Bootstrapped extensions: manifest content locale skin override Debugging a chrome manifest file The Chrome List extension shows all registered chrome. This is very helpful when trying to write a
chrome.manifest file as you can inspect where the files are being mapped from (jar files, local directory, etc.) Old-style contents.rdf manifests Before the plaintext manifests were introduced (which happened in Firefox 1.5, Toolkit 1.8), RDF manifests named "contents.rdf" were used to register chrome. This format is deprecated; however, SeaMonkey versions before version 2 do not support the plaintext manifest...
Using JavaScript code modules
n; otherwise, you may find yourself running the previous version of your module's code. The URL for a code module As you can see from the example above, you need a URL to import a code module. (The URL in the example is "resource://app/my_module.jsm".) Code modules can only be loaded using a chrome: (), resource:, or file: URL. If you're writing an extension for Firefox 4 and already have a
chrome.manifest with a content instruction in it, you can put the code module in your content folder and reference it like your other content files via chrome://<yourextension>/content/<yourmodule>.jsm. If your extension or application needs to support Mozilla 1.9.x (Firefox 3.x), you should register a new resource URL. Details on doing this are in the "Extending resource: URLs" section below. Sharing objects...
...L runtime The <relative-path> can be multiple levels deep and is always relative to the location defined by the <alias>. The common relative path is "modules" and is used by XUL Runner and Firefox. Code modules are simple JavaScript files with a .js or .jsm extension. <alias> must be unique to your add-on, as the application and other extensions share the same namespace for all aliases. ...
...e namespace for all aliases. ...
Index
mponent Object Model. Similar to Firefox, Thunderbird functionality can be enhanced and customized via extensions. 75 Building a Thunderbird extension 2: extension file layout Extensions, thunderbird Extensions are packaged and distributed in archive files (also known as Bundles), with the XPI (pronounced "zippy") file extension. At a minimum, they contain an install.rdf, the
chrome.manifest and a chrome/ folder. A content/ folder sometimes contains the actual content files. These files contain the code that makes your extension actually do something. When this tutorial is finished, our extension will look like this: 76 Building a Thunderbird extension 3: install manifest Extensions, thunderbird The install.rdf file is an XML file that provides general informatio...
... actually do something. When this tutorial is finished, our extension will look like this: 76 Building a Thunderbird extension 3: install manifest Extensions, thunderbird The install.rdf file is an XML file that provides general information about the extension. 77 Building a Thunderbird extension 4: chrome manifest Extensions, thunderbird The file called
chrome.manifest tells Thunderbird what packages and overlays are provided by the extension. Open the file called
chrome.manifest that you created and add this code: 78 Building a Thunderbird extension 5: XUL Extensions, thunderbird Thunderbird's user interface is written in XUL and JavaScript. XUL is an XML grammar that provides user interface widgets like buttons, menus, toolbars, trees etc...
... the complete details. Since window is a global variable you can use it directly from your JavaScript file. 96 Access Window Area NeedsUpdate, missing, thunderbird This page has no content. Enrich MDC by contributing. 97 Add New Tab missing, thunderbird No summary! 98 Add Option to Context Menu incomplete, thunderbird Assuming this on
chrome.manifest: 99 Add Tab NeedsUpdate, missing, thunderbird This page has no content. Enrich MDC by contributing. 100 Add Toolbar Button Example XUL overlay file: 101 Create Custom Column thunderbird The article "Creating a Custom Column" will get you well on the road to creating your own columns and populating them with custom data. The customDBH...
XUL Migration Guide - Archive of obsolete content
f community-developed modules that includes various user interface components. by using the SDK's low-level APIs you can directly modify the browser chrome. XUL Windows XUL windows are used to define completely new windows to host user interface elements specific to the add-on. The SDK generally expects you to specify your user interface using HTML, not XUL. However, you can include a
chrome.manifest file in your add-on and it will be included in the generated XPI. my-addon/ chrome/ content/ locale/ skin/
chrome.manifest data/ lib/ package.json There are limitations on what you can do in this manifest file: for example, you can't register overlays, resource: URIs, or components. However, you can register a chrome: URI, with a skin and locale, and...
...hrome/ content/ locale/ skin/
chrome.manifest data/ lib/ package.json There are limitations on what you can do in this manifest file: for example, you can't register overlays, resource: URIs, or components. However, you can register a chrome: URI, with a skin and locale, and this means you can include XUL windows in an SDK-based add-on. You can keep the "
chrome.manifest" file in your add-on's root directory and create a directory there called "chrome". In that directory you can keep your "content", "locale", and "skin" subdirectories: This allows you to refer to objects in these directories from "
chrome.manifest" using a relative path, like "chrome/content". This is provided only as a migration aid, and it's still a good idea to port XUL windows to HTML. C...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
rome://xulschoolhello/skin/hello-world.png"); } It's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead. The CSS file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in the
chrome.manifest file. This is very important because the toolbar customization dialog won't work correctly without this. The way to include the file in the manifest is to add this line: style chrome://global/content/customizeToolbar.xul chrome://xulschoolhello/skin/toolbar.css If you are using XBL bindings (explained way ahead) for your toolbar items, you'll have to include the CSS files for those as well, ea...
...rk involved in a toolbar that works on the aforementioned systems. If you want your toolbar to look right on all systems, you should consider having different icon sets for each. You should also consider using a graphic designer for this work, as it takes a lot of attention to detail to make good icons. You can have a different skin directory for each operating system using Manifest Flags in the
chrome.manifest file: skin xulschoolhello classic/1.0 skin/unix/ skin xulschoolhello classic/1.0 skin/win/ os=WINNT skin xulschoolhello classic/1.0 skin/mac/ os=Darwin The osversion flag can be used in case we wanted to have different icons for Mac OS X Lion and above, and others for older systems. In this example we won't bother. There is a separate skin directory for each system, with the Unix theme ...
Setting up an extension development environment - Archive of obsolete content
your install.rdf file, for example /full/path/to/yourExtension/ on Mac and Linux, and C:\full\path\to\yourExtension\ on Windows. Remember to include the closing slash and remove any trailing whitespace. Note: If you already installed the extension via XPI, you should uninstall it first before creating the pointer file. Also note that the use of proxy files requires that the extension's
chrome.manifest defines its chrome urls using traditional directories, rather than a JARed structure. See below. Place the file in the extensions folder of your profile and restart the application. Using directories rather than JARs Regardless of whether you choose to eventually package your extension's chrome in a JAR or in directories, developing in directories is simpler. If you choose a JARed struct...
...e. See below. Place the file in the extensions folder of your profile and restart the application. Using directories rather than JARs Regardless of whether you choose to eventually package your extension's chrome in a JAR or in directories, developing in directories is simpler. If you choose a JARed structure for releasing, you can still develop with a directory structure by editing your
chrome.manifest. For example, rather than having content myExtension jar:chrome/myExtension.jar!/content/ use content myExtension chrome/content/ Preventing the first launch extension selector Requires Gecko 8.0(Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Starting in Firefox 8, on the first launch of a new version of Firefox, it presents user interface letting users select which third party add-on...
Index - Archive of obsolete content
es No summary! 407 toolbarBindings.xml Add-ons, Themes No summary! 408 Creating a Skin for SeaMonkey 2.x SeaMonkey You're going to make a theme for SeaMonkey 2, but don't know how? I hope this manual will help you. 409 Getting Started The folder containing Seamonkey is called folder_with_seamonkey in this manual. ...
... Creating a Skin for SeaMonkey 2.x SeaMonkey You're going to make a theme for SeaMonkey 2, but don't know how? I hope this manual will help you. 409 Getting Started The folder containing Seamonkey is called folder_with_seamonkey in this manual. 410
chrome.manifest Copy the following text and paste it into a text file, then save that file as "
chrome.manifest": 411 install.rdf Copy the following text and paste it into a text file, then save that file as "install.rdf": 412 Creating a hybrid CD Developing Mozilla, Outdated_articles No summary! 413 Creating regular expressions for a microsummary generator Microsummaries, Obsolete A regular expression is a special kind of string (i.e. a seque...
Getting Started - Archive of obsolete content
ectory put a ZIP archive called My_Theme.jar containing navigator, global, communicator, editor, help, messenger, messenger-newsblog and mozapps directories from above. (Yes, this means that the structure of your new directory and classic.jar will be slightly different.) Creating the Install Files Icon.png and preview.png These are some PNG images containing the icon and the preview of the theme.
Chrome.manifest Make a copy of
chrome.manifest and place it in \My_Theme and open it up in your text editor. This file is a small manifest file which is used to describe the skin. In the code search for all instances of "My_Theme" and replace them with the name of your theme. The packages section lists which components of the browser you're modifying. If we also had skins for Chatzilla, we would need to add anot...
...Once you have put the files in the zip folder, rename it to myskin.jar Triggering the install from the web To install the theme's JAR file directly from the web, you need to run some JavaScript. <a hre...
Repackaging Firefox - Archive of obsolete content
t the very least, don't skip the "Important Extension Preferences" section below. Sample DEX The best way to get started is probably to look at a simple DEX and modify it for your own purposes. Download the sample. XPI files are specially crafted ZIP files in disguise. You can use any ZIP program (WinZIP on Windows, zip on Mac or Linux, etc) to extract it. ...
... components/PartnerBookmarks.js From the CCK extension, and it allows us to drop in default bookmarks at profile creation. You should not need to edit this file. defaults/preferences/partner.js Default preferences for this DEX. install.rdf Meta-information about your extension, such as the creator (your organization), a unique ID, a...
Custom toolbar button - Archive of obsolete content
lines. Optionally remove the sections for target applications that you do not want. Save the file. Explanation: This file contains information used by the application's extension manager. Sections for target applications specify the versions where the extension works. The last section in the file specifies that this extension adds content to the application. 4. Create a plain text file named
chrome.manifest. Copy the following content, and paste it into the new file: content custombutton chrome/ style chrome://global/content/customizeToolbar.xul chrome://custombutton/content/button.css # Firefox overlay chrome://browser/content/browser.xul chrome://custombutton/content/button.xul # Thunderbird mail overlay chrome://messenger/content/messenger.xul chrome://custombutton/content/button.xul # Thund...
... that your made-up name is not a real domain, add .invalid to the end. Use your new extension ID to rename the directory, and specify the same ID in your install.rdf file. In your install.rdf file, remove the sections for applications where your button does not work. For example, if your button only works in Thunderbird, remove the sections for Firefox and Sunbird. Do the same in button.xul and
chrome.manifest. Change "custombutton", "custom-button" and "CustomButton" to something else throughout all the files. Optionally change: The button image or images The extension icon, icon.png The version and home page in your install.rdf file Use a jar tool or zip tool to pack the contents of the directory. Name the packed file with the extension .xpi and make it available to other users. Users can i...
Using the standard theme - Archive of obsolete content
nd will make the standard XUL widgets of your application use the selected chosen theme. You do not have to specify a specific file; Mozilla will determine by its own which files in the directory it needs to use. ...
...Note that you can also mix these two approaches, although it makes your code more readable when sticking to only one way. ...
Deploying XULRunner - Archive of obsolete content
ich is part of the application ... additional application files such as icons, etc myapplicationname.exe (This is the "stub executable"... you should copy and rename this file from xulrunner-stub.exe in your XULRunner installation.) xulrunner/ ... copy xulrunner/ to this directory When deploying with XULRunner 2.0 and above do the following: Move
chrome.manifest to the root directory, and adjust resource paths inside
chrome.manifest accordingly With XULRunner 9.0 or 10.0 you may need to copy "mozutils.dll" and/or "mozcrt19.dll" from the xulrunner directory to the root directory. This should be fixed with XULRunner 11.0 With XULRunner 11.0 you may need to copy "gkmedias.dll" from the xulrunner directory to the root directory Mac OS X On ...
... chrome/ ... chrome which is part of the application ... additional application files such as icons, etc MacOS/ xulrunner (This is the "stub executable"... you should copy this file from /Library/Frameworks/XUL.framework/Versions/1.8/xulrunner.) When deploying with XULRunner 2.0, move
chrome.manifest to the root directory, and adjust resource paths inside
chrome.manifest accordingly. Additionally, your Mac app will not run without a valid Info.plist file. Here's a sample one: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> ...
xulauncher - Archive of obsolete content
###### if [ ! ...
...nimal directory structure ############################################################################## mkdir -p $XULDIR mkdir -p $XULPREFDIR # create application.ini file ############################################################################## echo " [App] Vendor=xulauncher.sh Name=$XULNAME Version=0.0.1 BuildID=`date +%Y%m%d` [Gecko] MinVersion=1.8 MaxVersion=1.9 ">$XULAPPINI # create
chrome.manifest file ############################################################################## echo " content $XULNAME file:$XULNAME/ ">$XULMANIFEST # create prefs.js file ############################################################################## echo " pref(\"toolkit.defaultChromeURI\", \"chrome://$XULNAME/content/$XULFILE\"); /* debugging prefs */ pref(\"browser.dom.window.dump.enabled\", true); pref...
Frame script loading and lifetime
n flag, allowDelayedLoad Note: if the message manager is a global frame message manager or a window message manager, loadFrameScript() may load the script multiple times, once in each applicable frame. chrome: URLs Extension developers usually use a chrome:// URL to refer to the frame scripts. ...
...ger is a global frame message manager or a window message manager, loadFrameScript() may load the script multiple times, once in each applicable frame. chrome: URLs Extension developers usually use a chrome:// URL to refer to the frame scripts. To define the mapping between a chrome:// URL and a frame script packaged with an extension, use a "
chrome.manifest" file to register a chrome URL: //
chrome.manifest content my-e10s-extension chrome/content/ // chrome script mm.loadFrameScript("chrome://my-e10s-extension/content/content.js", true); allowDelayedLoad If the message manager is a global frame message manager or a window message manager then: If allowDelayedLoad is true, the frame script will be loaded into any new frame, which has opened after the loadFrameScript() call. For example: ...
Building a Thunderbird extension 2: extension file layout
Warning: This content is for older versions of Thunderbird. Much of it may no longer be relevant. See developer.thunderbird.net for newer information. Extensions are packaged and distributed in archive files (also known as Bundles), with the XPI (pronounced "zippy") file extension. At a minimum, they contain an install.rdf, the
chrome.manifest and a chrome/ folder. A content/ folder sometimes contains the actual content files. ...
...the
chrome.manifest and a chrome/ folder. A content/ folder sometimes contains the actual content files. These files contain the code that makes your extension actually do something. ...
Add Option to Context Menu
Assuming this on
chrome.manifest: overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myext/content/thunderbird-overlay.xul Add the next in thunderbird-overlay.xul. For Thunderbird 2 <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="messagePaneContext"> <menuitem id="my_option" label="My option concise and cool label" oncommand="alert('Hi')"/> </menupopup> </overlay> For Thunderbird 3 <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <popup id="mailContext"> <menuitem id="my_option" label="My option concise and cool l...
...eper/there.is.only.xul"> <popup id="mailContext"> <menuitem id="my_option" label="My option concise and cool label" oncommand="alert('Hi')"/> </popup> </overlay> For Thunderbird 2 and 3 in the same XPI If our extension needs to support Thunderbird 2 and 3 we need to make custom overlays for each version. This can be reached by adding these lines to the
chrome.manifest file: overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay-tb2.xul appversion<3.0 overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay-tb3.xul appversion=>3.0 Than we need two overlay XUL files with content from examples above. Note: If our extension supports more Mozilla applications (for example Mozilla Firefox and...
Developing for Firefox Mobile - Archive of obsolete content
info: starting info: starting zerdatime 1329258528988 - browser chrome startup finished. This will be followed by lots of debug output. On the device, you should see Firefox launch with your add-on installed. console.log() output from your add-on is written to the command shell, just as it is in desktop development. However, because there's a lot of other debug output in the shell, it's not...
Scrollbar - Archive of obsolete content
This example shows how to style the scrollbars in your xul application. Scrollbars inside browser elements will be styled to. Tested on windows xp. Example assumes a structure like this: app/chrome/
chrome.manifest app/chrome/skin/global/ Copy the scrollbars.css from xulrunner/chrome/classic.jar/skin/classic/global to app/chrome/skin/global/scrollbars.css Open the app/chrome/
chrome.manifest and add: skin app-global standard/1.0 skin/global/ override chrome://global/skin/xulscrollbars.css chrome://app-global/skin/scrollbars.css xulscrollbars.css are used for windows xp, and nativescrollbars.css on osx. So to make this work with osx, make an extra override: override chrome://global/skin/nativescrollbars.css chrome://app-global/skin/scrollbars.css Change some color values inside the app/chrome/sk...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
Place this code in a file called jar.mn in the root directory of your extension, making sure that the paths in parentheses point to actual files (when interpreted relative to the root directory). You also have to make one small change to the makefile in the same directory, adding the following line: USE_EXTENSION_MANIFEST = 1 This tells make to create a single manifest file called
chrome.manifest instead of creating separate manifests with goofy names for each package. Now launch make again, and you should see a chrome subdirectory appear in your extension (/mozilla/$(MOZ_OBJDIR)/dist/bin/extensions/myextension@mycompany.com/). Note that the chrome directory contains a JAR (i.e. ZIP) file with all the chrome files listed in jar.mn as well as a complete directory structure mirroring...
Extension Etiquette - Archive of obsolete content
often extended to add methods to native objects. Global variables, such as top-level declarations on scripts loaded into shared windows or web pages. Expando properties of shared objects, such as document objects, or DOM nodes. IDs and class names in HTML and XUL documents, when extensions add elements to web pages or browser windows. chrome: or resource: packages, which are often defined in
chrome.manifest files. about: page URLs. XPCOM contract IDs, which are often registered in
chrome.manifest files. While these are among the most common examples of namespaces in which conflicts can occur, there are many others. In general, care must be taken whenever defining a name anywhere that other code might do likewise. Strategies to avoid such conflicts include: Avoid shared namespaces where possib...
Custom XUL Elements with XBL - Archive of obsolete content
ne binding per file, the "#person" part points to the id of the one we want. This CSS file is located in the content because it's not something we would normally want to be replaced by a skin, and it's not really defining style; it defines content behavior instead. If you use bindings on toolbar elements, remember to include the CSS file in the customize dialog, using the style directive in the
chrome.manifest file. With those 2 files properly defined, we can now use the new element. If you look at file bindingDialog.xul, you'll see that the CSS stylesheet is included, which means that the xshelloperson tag can now be used just like any XUL tag. In this case we're adding the "Persons" dynamically, so you'll have to look into the JS file to see how xshelloperson elements are created and added to the DO...
Getting Started with Firefox Extensions - Archive of obsolete content
hoose the Save Link As... option. Decompress the XPI file in a convenient location. Issue the following command to unzip the file on Linux or Mac OS X: unzip xulschoolhello1.xpi -d xulschoolhello1 On Windows, you can change the file extension from xpi to zip, or open the file directly, then unzip it, using a ZIP tool. You should see the following directory structure: xulschoolhello1
chrome.manifest install.rdf content browserOverlay.xul browserOverlay.js skin browserOverlay.css locale en-US browserOverlay.dtd browserOverlay.properties That's lots of files for something so simple! In the next section, we'll inspect these files and see what they do. << PreviousNext >> Thi...
JavaScript Object Management - Archive of obsolete content
one of them, and they are covered in another section of this tutorial. Two other ways are JavaScript Code Modules (Firefox 3 and above), and XPCOM. JavaScript Code Modules JavaScript Code Modules (also known as JSM) are new to Firefox 3, and they're the best tool for keeping everything in sync between windows. They're very simple to set up. The first thing you need to do is add an entry in the
chrome.manifest file: resource xulschoolhello modules/ Javascript code modules are accessed with the resource protocol, which is very similar to the chrome protocol. Just like with the chrome, we define the package name and then a path. To keep things simple, just locate the JSM files in a modules directory under the root of our project. In order to access a file messageCount.js in this directory, th...
Setting Up a Development Environment - Archive of obsolete content
ring development and testing. More about this further ahead. Let's try and build the XPI from the command line first. Open the command line program in your system and navigate to the src directory in your project. Run the following command: make That's it. If everything went well, you should see an output similar to this: Creating XPI file. adding: install.rdf (deflated 50%) adding:
chrome.manifest (deflated 50%) adding: content/browserOverlay.js (deflated 42%) adding: content/browserOverlay.xul (deflated 69%) adding: skin/browserOverlay.css (stored 0%) adding: locale/browserOverlay.dtd (deflated 52%) adding: locale/browserOverlay.properties (stored 0%) Creating XPI file. Done! Build finished successfully. If you inspect the bin directory, you should see the xulschoolhello2.x...
Signing an extension - Archive of obsolete content
ng 2010 CA - VeriSign, Inc." -t "C,C,C" -d . It's all done. Sign The basic usage of the signing tool is as follows: nss-signtool \ -d (path to the directory that contains your certificate database files) \ -k (your certificate nickname) \ -p (your certificate password) \ -X -Z (output path/name of signed file) \ (path to your extension working directory that contains chrome directory,
chrome.manifest file, install.rdf file, etc.) Writing your password directly in the script is dangerous. For production, use such a code: echo "Enter password for Object Signing:" read MYPASSWORD nss-signtool \ -d /Volumes/Codesign/keystore \ -k "My Company's VeriSign, Inc. ID" \ -p $MYPASSWORD \ -X -Z ~/Desktop/MyExtension/dest/MyExtension-1.0.xpi \ ~/Desktop/MyExtension/source unset MYPASSWORD Then a ...
Creating a status bar extension - Archive of obsolete content
on the format of an install manifest, read the Install Manifests section. The chrome manifest The chrome manifest is a file that tells the target application where to look for the chrome package for your extension. The chrome is the set of user interface elements outside the content area of the application's window, such as toolbars, status bars, menu bars, and the like. The chrome manifest file,
chrome.manifest, for the sample follows. content status-bar-sample-1 chrome/content/ # Firefox overlay chrome://browser/content/browser.xul chrome://status-bar-sample-1/content/status-bar-sample-1.xul The first line registers the location on disk of the contents of the extension whose ID is "status-bar-sample-1". This path is relative to the extension's root folder in this case, but can be absolute if you w...
Index of archived content - Archive of obsolete content
Release Tag Creating a Skin for Firefox/Getting Started Creating a Skin for Mozilla FAQ Getting Started In-Depth Links contents.rdf toolbarBindings.xml Creating a Skin for SeaMonkey 2.x Getting Started
chrome.manifest install.rdf Creating a hybrid CD Creating regular expressions for a microsummary generator DTrace Dehydra Dehydra Frequently Asked Questions Dehydra Function Reference Dehydra Object Reference Installing Dehydra Using Dehydra ...
Localizing an extension - Archive of obsolete content
onding entity. For example, in stockwatcher2.xul, we change this line: <menuitem label="Refresh Now" oncommand="StockWatcher.refreshInformation()"/> to <menuitem label="&menu_refresh_now.label;" oncommand="StockWatcher.refreshInformation()"/> Do this for every string used in each XUL file. Update the chrome manifest To let Firefox know about the locale files, we need to make a revision to our
chrome.manifest file, adding one line for each localization: locale stockwatcher2 en-US chrome/locale/ This instructs Firefox that the en-US localization is located in the chrome/locale/en-US directory. Localizing strings in JavaScript code If your JavaScript code contains literal strings that need to be localized, as does our stock watcher sample, we need to make those localizable as well. We can do this by m...
Providing Command-Line Options - Archive of obsolete content
ne interface. Example The below example component implements two command line parameters: firefox.exe -myapp Opens a chrome window for My Application. firefox.exe -viewapp url Opens a chrome window for My Application and passes it an nsIURI object. ...
Localization - Archive of obsolete content
dd a line of the following form somewhere near the top of the XUL file: <!DOCTYPE window SYSTEM "chrome://findfile/locale/findfile.dtd"> This line specifies that the URL indicated is to be used as a DTD for the file. In this case, we have declared that we want to use the findfile.dtd DTD file. This line is typically placed just before the window element. You also need to add the locale to the
chrome.manifest file, for example: locale findfile en-US locale/ Declaring Entities The entities are declared using a simple syntax as shown below: <!ENTITY findLabel "Find"> This example creates an entity with the name findLabel and the value "Find". This means that wherever the text "&findLabel;" appears in the XUL file, it will be replaced with the text "Find". Note that entity declarations do not have...
Manifest Files - Archive of obsolete content
to see what packages are installed. That means that all you need to do to install a new package is add a new manifest file either into the application chrome directory or the user specific chrome directory. This latter chrome directory is normally the one used since the application directory might not have sufficient permissions to write into it. Note: Starting in Gecko 2.0, only the file named
chrome.manifest is read automatically; if you need to read multiple manifest files, use the manifest command in that file to import additional manifests. Use manifest flags to configure the scenarios in which the secondary manifest is imported. If you just want to try testing privileged XUL code in the Firefox browser, you can do this easily by just using a manifest with only one line in it: Create a new dire...
How to enable locale switching in a XULRunner application - Archive of obsolete content
locale selection The next step is to add a XUL control to your application which lists the available locales in the package and makes it possible for the user to select one of them. I chose a listbox with a button. Screenshot of sample locale switching control 3. Populate the XUL control with the available locales The available package locales are declared in the chrome manifest. Sample chrome/
chrome.manifest content localeswitchdemo content/ locale localeswitchdemo de-DE locale/de-DE/ locale localeswitchdemo en-GB locale/en-GB/ locale localeswitchdemo fr-FR locale/fr-FR/ How are you going to populate the XUL listbox? You can hardwire the choices into the XUL code using fixed list items, or could take the elegant approach and construct the list dynamically. The dynamic list population req...
omni.ja (formerly omni.jar)
t options when packing the extracted files. The correct command to pack omni.ja is: zip -0DXqr omni.ja * The working directory must be at the root directory of the files from the omni.ja file. zip -0DXqr omni.ja path/to/omni/* will not work. Note: Prior to Firefox 10 and Thunderbird 10, omni.ja was called omni.jar. omni.ja contents The omni.ja file contains assorted application resources:
chrome.manifest The chrome manifest file. /chrome/ User interface files for the application /chrome/localized.manifest Manifest of localized content; referenced by the main chrome manifest file. /chrome/nonlocalized.manifest Manifest of non-localized content; referenced by the main chrome manifest file. /components/ XPCOM components the application relies upon. /defaults/ Default preference files. /m...
Interface Compatibility
s is the recommended way for extensions to call into OS or third-party native code. You should strongly consider migrating existing code to use js-ctypes instead of binary components. If necessary, it is possible for an extension to support multiple versions by shipping multiple shared libraries (DLLs) in the same extension package, and selecting the correct version using versioning flags in its
chrome.manifest file. JSAPI, NSPR, NSS, and other libraries which are currently shipped as separate shared libraries may be integrated into libxul, and extension authors should avoid linking against them. ...
L10n Checks
file, usually found in $APP/locales/l10n.ini. You pass both the path to the ini file and the parent directory of the localizations as first arguments, followed by the locale codes of the locales you want to compare. If you want to test the localization for de, run: check-l10n-completeness browser/locales/l10n.ini ../l10n/ de Add-ons (xpi) mode L10n Checks gathers the locales to compare from the
chrome.manifest file inside the xpi file. You pass the path to the xpi file (optionally) followed by the locale codes of the locales you want to compare. If you want to test the localization for de, run: check-l10n-completeness -i xpi my-extension.xpi de To check all locales in an extension: check-l10n-completeness -i xpi my-extension.xpi Language packs (xpis) mode L10n Checks can compare two locales found in ...
How to build an XPCOM component in JavaScript
See XPCOM changes in Gecko 2.0 for more details. Installation For extensions: Copy HelloWorld.js, and HelloWorld.xpt (only if you defined and compiled the IDL) to {extensiondir}/components/. Delete compreg.dat and xpti.dat from your profile directory. Restart application. For Firefox: Copy HelloWorld...
Receiving startup notifications
e. Receiving startup notifications in Gecko 2.0 (Firefox 4) and later In order to improve startup times, changes were made to the XPCOM startup process. See The startup process for details on how this now works, if you're interested in specifics. The important thing to note is that now instead of registering with the Category Manager programmatically as was done in the past, you add lines to your
chrome.manifest to let the application handle it for you. For example: category profile-after-change MyComponent @foobar/mycomponent;1 Important: In the past, the contract ID of the category entry started with "service," if the component was implemented as a service. This is no longer the case, so be sure to remove that when migrating existing code. Additionally, the earliest startup time notification you can re...
Index
table, XPCOM, XPCOM API Reference, XPCOM Interface Reference The nsICommandLineRunner is an extension of nsICommandLine used to initialize command lines and run them by processing the comand line handlers. 411 nsIComponentManager Component Manager, Components, Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference Loads a "bootstrapped"
chrome.manifest file from the specified directory or XPI file. A "bootstrapped" chrome manifest supports some of the instructions allowed in a regular chrome manifest, see the Chrome Registration documentation for details. 412 createInstanceByContractID No summary! 413 getClassObject No summary! 414 getClassObjectByID No summary! 415 ns...