XPCOM changes in Gecko 2.0 - MDC. Several changes that affect XPCOM component compatibility are taking place in Gecko 2.
This article details those changes, and provides suggestions for how to update your code. No more frozen interfaces There are no longer any frozen interfaces; from now on, all interfaces are subject to change. Documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen. " Component registration The way XPCOM components are registered changed in Gecko 2.
Starting in Gecko 2, however, components are registered using manifest files, similarly to how chrome is registered. All existing XPCOM components will need to be updated to support this. Component manifests All component registration is now handled through manifest files. 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 chrome.manifest: For example, in your component's JavaScript code : But why? Services namespace - MDC. Toolbar - MDC. This article is in need of a technical review.
Adding a toolbar button There are two tutorials available: An elaborate step by step tutorial for beginners: Custom Toolbar Button A tutorial describing the steps needed to add a toolbar button assuming you already have a working extension and know the basics of extension development: Creating toolbar buttons Adding button by default When you create and deploy your extension and include a toolbar button for it by overlaying the Customize toolbarpalette, it is not available by default. Notes Insert your button by default only once, at first run, or when an extension update adds a new button. Function installButton(toolbarId, id, afterId) { if (! See also Document Tags and Contributors Contributors to this page:Sheppy, Nmaier, Kray2, ericjung, GavinSharp, EhpNbr, MarkFinkle, Hendry, Nickolay, Philip Chee, wbamberg, Jorge.villalobos, kmaglione, mnoorenberghe, Mgjbot, Ptak82, Kinger, waldir, darktrojan, ducky_boy.
XPCOM API Reference - MDC. This article is in need of a technical review.
This page is the new home of the XPCOM Reference that we are migrating from here. If you are inclined to help with this migration, your help would be very much appreciated. There may also be additional information located in Creating XPCOM Components Appendix B; it is unclear how much of the documentation in CXC overlaps with that from the to-be-migrated XPCOM reference mentioned in the last paragraph. Please see the talk page for information about available templates and categories you should use when creating / editing pages. Overview This reference describes the frozen interfaces and functions provided by the XPCOM library. Note: If you are working on a module in the Mozilla codebase that is compiled with MOZILLA_INTERNAL_API, then some of these APIs--the string functions and classes in particular--may differ significantly from what you should use. Return values Frozen Components nsCategoryManager The XPCOM Category Manager. nsDirectoryService.
Gecko:Getting Started. Gecko:Home Page. Adding a New Protocol to Mozilla. Adding a New Protocol to Mozilla Doron Rosenberg, IBM Corporation.
This article demonstrates how to add a new protocol to Mozilla. JavaScript and XPCOM will be used to implement the protocol, and will also cover adding it to an existing Mozilla installation. Introduction Mozilla supports the generic web protocols, such as http and ftp. To add a new protocol, one needs to implement an XPCOM component. The example this article builds will be the "search:" protocol, which will use the user's default search engine to initiate a search. The XPCOM Shell Figure 1 (below) shows the basic structure of the XPCOM JavaScript shell needed to implemenet a new protocol.
The XPCOM shell code will be covered quickly, as none of it has to be modified to create a new protocol. Figure 1: Basic structure of the XPCOM Shell // XPCOM constant definitions // Protocol definition // ProtocolFactory definition // TestModule definition function NSGetModule(){ return TestModule; } Figure 2: Constants used. Creating a new protocol for Mozilla Firefox in C++ Introduction This article is to show you how to create a new protocol for Mozilla Firefox browser.
Mozilla Firefox supports the generic web protocols, such as HTTP and FTP and it also support protocols like Chrome of its own. It is sometime required to make a custom protocol for your project which will be plugged with the existing Firefox installation. To create a new protocol, you’ll need to implement an XPCOM component. XPCOM is very similar to MS COM (and in this article basics of the XPCOM will not be covered, you can find so many good articles and online books on XPCOM). In this article we’ll use C++ to build the XPCOM for the protocol. One other place you can find implementation of protocol in C++ is in Mozilla’s site and it is a little bit complex and less documented. What does this sample protocol do?