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 566253 of XPCOM

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

Revision Content

An Introduction to XPCOM

A tutorial from IBM developerWorks: Tutorial

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.

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.

Documentation

XPCOM API Reference
Documentation of core components, interfaces, and functions provided by XPCOM.
XPCOM changes in Gecko 2
A number of changes in Gecko 2 affect compatibility of XPCOM components. This article details those changes.
String, hashtable, array and stream guides
Using the basic data structures.
XPCOM Glue
The XPCOM Glue allows using XPCOM utility functions and classes, without having a dependency on unfrozen parts of XPCOM (xpcom_core.{dll,so,dylib}).
Creating XPCOM Components
This book provides a tutorial about building an XPCOM component that controls browsing behavior.
How to Build an XPCOM Component in Javascript
Quick-start guide for writing JavaScript components
How to Build an XPCOM Component in C++
Don't let extensions in the title fool you - the article is mainly about binary components Linux and Windows HowTo, Windows HowTo, Redux, OS/X HowTo
Using XPCOM in JavaScript without leaking
Using XPCOM in JavaScript (also known as XPConnect) is an environment where memory management issues are not obvious. Despite this, it's easy to write JavaScript code that leaks, because some of the objects you're dealing with are reference-counted behind the scenes.

View All...

Community

  • View Mozilla forums...{{DiscussionList("dev-tech-xpcom", "mozilla.dev.tech.xpcom")}}

Tools

{{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")}}

{{MakeSimpleQuicklinks("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

<div class="callout-box">
 <strong>An Introduction to XPCOM</strong><br />
 <p>A tutorial from <a class="external" href="https://www.ibm.com/developerworks/">IBM developerWorks</a>: <a class="external" href="https://www.ibm.com/developerworks/library/os-xpcomfirefox/">Tutorial</a></p>
</div>
<div>
 <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>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>
</div>
<table class="topicpage-table">
 <tbody>
  <tr>
   <td>
    <h2 class="Documentation" id="Documentation" name="Documentation">Documentation</h2>
    <dl>
     <dt>
      <a href="/en-US/docs/XPCOM_API_Reference" title="XPCOM_API_Reference">XPCOM API Reference</a></dt>
     <dd>
      Documentation of core components, interfaces, and functions provided by XPCOM.</dd>
     <dt>
      <a href="/en-US/docs/XPCOM/XPCOM_changes_in_Gecko_2.0" title="XPCOM/XPCOM changes in Gecko 1.9.3">XPCOM changes in Gecko 2</a></dt>
     <dd>
      A number of changes in Gecko 2 affect compatibility of XPCOM components. This article details those changes.</dd>
     <dt>
      <a href="/en-US/docs/Mozilla_internal_string_guide" title="Mozilla_internal_string_guide">String</a>, <a href="/en-US/docs/XPCOM_hashtable_guide" title="XPCOM_hashtable_guide">hashtable</a>, <a href="/en-US/docs/XPCOM_array_guide" title="XPCOM_array_guide">array</a> and <a href="/en-US/docs/XPCOM_Stream_Guide" title="/en-US/docs/XPCOM_Stream_Guide">stream</a> guides</dt>
     <dd>
      Using the basic data structures.</dd>
     <dt>
      <a href="/en-US/docs/XPCOM_Glue" title="XPCOM_Glue">XPCOM Glue</a></dt>
     <dd>
      The XPCOM Glue allows using XPCOM utility functions and classes, without having a dependency on unfrozen parts of XPCOM (xpcom_core.{dll,so,dylib}).</dd>
     <dt>
      <a href="/en-US/docs/Creating_XPCOM_Components" title="Creating_XPCOM_Components">Creating XPCOM Components</a></dt>
     <dd>
      This book provides a tutorial about building an XPCOM component that controls browsing behavior.</dd>
     <dt>
      <a href="/en-US/docs/How_to_Build_an_XPCOM_Component_in_Javascript" title="How_to_Build_an_XPCOM_Component_in_Javascript">How to Build an XPCOM Component in Javascript</a></dt>
     <dd>
      Quick-start guide for writing JavaScript components</dd>
     <dt>
      <a href="/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System" title="Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System">How to Build an XPCOM Component in C++ </a></dt>
     <dd>
      Don't let <em>extensions</em> in the title fool you - the article is mainly about binary components <a class="external" href="https://www.iosart.com/firefox/xpcom/">Linux and Windows HowTo</a>, <a class="external" href="https://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/">Windows HowTo</a>, <a class="external" href="https://wanderingstan.com/2007-11-16/geekout_how_to_make_a_c_xpcom_component">Redux</a>, <a class="external" href="https://rcrowley.org/2007/07/17/cross-platform-xpcom-a-howto.html">OS/X HowTo</a></dd>
     <dt>
      <a href="/en-US/docs/Using_XPCOM_in_JavaScript_without_leaking" title="Using_XPCOM_in_JavaScript_without_leaking">Using XPCOM in JavaScript without leaking</a></dt>
     <dd>
      Using XPCOM in JavaScript (also known as <a href="/en-US/docs/XPConnect" title="XPConnect">XPConnect</a>) is an environment where memory management issues are not obvious. Despite this, it's easy to write JavaScript code that leaks, because some of the objects you're dealing with are reference-counted behind the scenes.</dd>
    </dl>
    <p><span class="alllinks"><a href="/en-US/docs/tag/XPCOM" title="tag/XPCOM">View All...</a></span></p>
   </td>
   <td>
    <h2 class="Community" id="Community" name="Community">Community</h2>
    <ul>
     <li>View Mozilla forums...{{DiscussionList("dev-tech-xpcom", "mozilla.dev.tech.xpcom")}}</li>
    </ul>
    <h2 class="Tools" id="Tools" name="Tools">Tools</h2>
    <ul>
     <li><a class="external" href="https://ted.mielczarek.org/code/mozilla/jscomponentwiz/">JavaScript Component Wizard</a></li>
     <li><a class="external" href="https://www.mytools360.com-a.googlepages.com/home#XPComPro" title="https://www.mytools360.com-a.googlepages.com/home#XPComPro">Visual C++ Component Wizard</a></li>
     <li><a href="https://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en" title="https://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en">Visual C++ Component Wizard for vs2010</a></li>
    </ul>
    <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related Topics</h2>
    <ul>
     <li><a href="/en-US/docs/XPCOM/Language_Bindings" title="XPCOM/Language_Bindings">Language Bindings</a>, <a href="/en-US/docs/JavaXPCOM" title="JavaXPCOM">JavaXPCOM</a>, <a href="/en-US/docs/XPConnect" title="XPConnect">XPConnect</a>, <a href="/en-US/docs/PlXPCOM" title="PlXPCOM">PlXPCOM</a>, <a href="/en-US/docs/PyXPCOM" title="PyXPCOM">PyXPCOM</a>, <a href="/en-US/docs/RbXPCOM" title="RbXPCOM">RbXPCOM</a>, <a href="/en-US/docs/JavaScript" title="JavaScript">JavaScript</a></li>
    </ul>
   </td>
  </tr>
 </tbody>
</table>
<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")}}</p>
<p>{{MakeSimpleQuicklinks("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