Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1119309 of XPCOM

  • Revision slug: Mozilla/Tech/XPCOM
  • Revision title: XPCOM
  • Revision id: 1119309
  • Created:
  • Creator: Sheppy
  • Is current revision? Yes
  • Comment

Revision Content

XPCOM is a cross platform component object model, similar to Microsoft COM. It has multiple language bindings, allowing XPCOM components to be used and implemented in JavaScript, Java, and Python in addition to C++. Interfaces in XPCOM are defined in a dialect of IDL called XPIDL.

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

XPCOM itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. The majority of XPCOM components are not part of this core set and are provided by other parts of the platform (e.g. Gecko or Necko) or by an application or even by an extension.

{{LandingPageListSubpages}}

{{CommunityBox("XPCOM", "dev-tech-xpcom", "mozilla.dev.tech.xpcom", "developers", "Tools|https://ted.mielczarek.org/code/mozilla/jscomponentwiz/|JavaScript Component Wizard++https://www.mytools360.com-a.googlepages.com/home#XPComPro|Visual C++ Component Wizard++https://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en|Visual C++ Component Wizard for Visual Studio 2010++https://addons.mozilla.org/en-US/firefox/addon/xpcomviewer/|XPCOMViewer addon: browse XPCOM interfaces easily")}}

{{MakeSimpleQuicklinks("https://www.ibm.com/developerworks/library/os-xpcomfirefox/|Tutorial from IBM DeveloperWorks", "https://developer.mozilla.org/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System|Binary components tutorial", "https://www.iosart.com/firefox/xpcom/|Linux and Windows how-to guide", "https://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/|Windows example blog post", "https://wanderingstan.com/2007-11-16/geekout_how_to_make_a_c_xpcom_component|Another Windows example", "https://rcrowley.org/2007/07/17/cross-platform-xpcom-a-howto.html|Mac OS X example", "/en-US/docs/Web/JavaScript")}}

Revision Source

<p><span class="seoSummary"><strong>XPCOM</strong> is a cross platform component object model, similar to Microsoft COM. It has multiple <a href="/en-US/docs/XPCOM/Language_Bindings" title="XPCOM/Language_Bindings">language bindings</a>, allowing XPCOM components to be used and implemented in JavaScript, Java, and Python in addition to C++.</span> Interfaces in XPCOM are defined in a dialect of IDL called <a href="/en-US/docs/XPIDL" title="XPIDL">XPIDL</a>.</p>

<div class="warning">
<p><strong>WebExtensions are becoming the new standard for creating add-ons. </strong>Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a> API, and <a href="https://mzl.la/webext-feature-needed">report any missing functionality</a> so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a>. In addition, any binaries you use will then need to be converted for use with the WebExtensions <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">native messaging</a> API, or compiled using <a href="https://webassembly.github.io/">WebAssembly</a> or <a href="/en-US/docs/Mozilla/Projects/Emscripten">Emscripten</a>.</p>
</div>

<p>XPCOM itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. The majority of XPCOM components are not part of this core set and are provided by other parts of the platform (e.g. <a href="/en-US/docs/Gecko" title="Gecko">Gecko</a> or <a href="/en-US/docs/Necko" title="Necko">Necko</a>) or by an application or even by an extension.</p>

<p>{{LandingPageListSubpages}}</p>

<p>{{CommunityBox("XPCOM", "dev-tech-xpcom", "mozilla.dev.tech.xpcom", "developers", "Tools|https://ted.mielczarek.org/code/mozilla/jscomponentwiz/|JavaScript Component Wizard++https://www.mytools360.com-a.googlepages.com/home#XPComPro|Visual C++ Component Wizard++https://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en|Visual C++ Component Wizard for Visual Studio 2010++https://addons.mozilla.org/en-US/firefox/addon/xpcomviewer/|XPCOMViewer addon: browse XPCOM interfaces easily")}}</p>

<p>{{MakeSimpleQuicklinks("https://www.ibm.com/developerworks/library/os-xpcomfirefox/|Tutorial from IBM DeveloperWorks", "https://developer.mozilla.org/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System|Binary components tutorial", "https://www.iosart.com/firefox/xpcom/|Linux and Windows how-to guide", "https://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/|Windows example blog post", "https://wanderingstan.com/2007-11-16/geekout_how_to_make_a_c_xpcom_component|Another Windows example", "https://rcrowley.org/2007/07/17/cross-platform-xpcom-a-howto.html|Mac OS X example", "/en-US/docs/Web/JavaScript")}}</p>
Revert to this revision