Search code examples
javascriptfirefoxxul

Why does a ChromeWorker throw "Components is not defined"?


The documentation on ChromeWorkers says that they have "chrome privileges", and chrome privileges are supposed to mean they can do anything, but when I create a ChromeWorker and try to use Components I get an error that 'Components' is not defined..

So my question is

  1. why is Components not available?
  2. what is available to a ChromeWorker?

Solution

  • You cannot access the Components object because the Components object isn't threadsafe. A ChromeWorker gives you access to everything a Worker has access to, and c-types.