title: Firefox Extension/Addon Binary Component Backward Compatibility
body: <p>I have been reading up and looking at ways to compile binary components for Firefox extensions. Since Firefox 5 is being released (and 6 &amp; 7 coming up soon) I was wondering if binary components are worth making anymore or just use a standalone executable to run the functionality I want.</p>
  
  <p>I got a sample binary component to compile for Firefox 5 but when I tested it on Firefox 3.6, I get this error:</p>
  
  <pre><code>[Exception... "Could not convert Native argument arg 0 [nsISupports.QueryInterface]" nsresult: "0x8057000a (NS_ERROR_XPC_BAD_CONVERT_NATIVE)"
  </code></pre>
  
  <p>Running this code </p>
  
  <pre><code>var obj = Components.classes['@example.com/MyComponent;1'].QueryInterface(Components.interfaces.IMyComponent);
  </code></pre>
  
  <p>And errors at the QueryInterface. Apparently building for Firefox 4 (XULrunner-sdk 2.0 instead of 5.0 will work).</p>
  
  <p>Here is the module code:</p>
  
  <pre><code>#include "mozilla/ModuleUtils.h"
  #include "MyComponent.h"
  
  NS_GENERIC_FACTORY_CONSTRUCTOR(MyComponent)
  
  NS_DEFINE_NAMED_CID(MY_COMPONENT_CID);
  
  static const mozilla::Module::CIDEntry kMyComponentCIDs[] = {
      { &amp;kMY_COMPONENT_CID, false, NULL, MyComponentConstructor },
      { NULL }
  };
  
  static const mozilla::Module::ContractIDEntry kMyComponentContracts[] = {
      { MY_COMPONENT_CONTRACTID, &amp;kMY_COMPONENT_CID },
      { NULL }
  };
  
  static const mozilla::Module kMyComponentModule = {
      mozilla::Module::kVersion,
      kMyComponentCIDs,
      kMyComponentContracts,
      NULL
  };
  
  NSMODULE_DEFN(NS_MyComponent_Module) = &amp;kMyComponentModule;
  NS_IMPL_MOZILLA192_NSGETMODULE(&amp;kMyComponentModule)
  </code></pre>
  
  <p>I also heard that FF3.6 doesn't need to have the xpt or the dll inside the manifest file. </p>
  
  <p>So basically my question is, for backward compatibility would it be better to make an executable or continue to make binary components? (Since it looks like compiling for FF5, FF3.6 broke.)</p>