I'm crawling about 20 Web sites in the background, when a page loads, within the addon script, with the page-worker. Unfortunately the browser freezes, unpredictable during that time.

I tried to use timers.setTimeout(..., 0-400ms) and also tried the example from the wiki

```
function executeSoon(aFunc) {
    var tm = Cc["@mozilla.org/thread-manager;1"]
        .getService(Ci.nsIThreadManager);

    tm.mainThread.dispatch({
        run: function () {
            aFunc();
        }
    }, Ci.nsIThread.DISPATCH_NORMAL);
}

```

but this also freezes the UI. Is there any other solution?

The crawling code:

```
...
timer.setTimeout(function () {
    let pageWorker = require("sdk/page-worker").Page({
       contentScriptFile: self.data.url("js/extractor.js"),
           contentURL:        url
    });

    pageWorker.port.on("loaded", function (content) {
        if (typeof callback === 'function') {
            callback(content);
        }
    });
}, 200)
...

```

The extractor.js, even in simpler cases, where it return body.textContent, is blocking.