You can do so by using ChromeWorker instead of the standard
Worker object. It works exactly like a standard
Worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker
Obsolete since Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
nsIWorkerFactoryinterface has been removed
var workerFactory = Components.classes['@mozilla.org/threads/workerfactory;1'] .createInstance(Components.interfaces.nsIWorkerFactory); var worker = workerFactory.newChromeWorker('script_url.js');
This will create a new chrome worker that will immediately begin to run the script at the specified URL (in this case, "script_url.js"). For example, "script_url.js" can be "chrome://extension_name/content/script.js".