javascriptinternet-explorerbrowser-extensioncrossrider

Why does it take so much time for the background to load in CrossRider?


We are using CrossRider to develop an extension for Internet Explorer. I tested our extension in staging mode, and there is an alert in the background and in extension.js in the function appAPI.ready:

extension.js:

appAPI.ready(function($) {
    alert("appAPI.platform = " + appAPI.platform);
});

background.js:

appAPI.ready(function($) {
    alert("appAPI.platform = " + appAPI.platform);
});

The alert in extension.js happens immediately after I install the extension, but the alert in background.js happens only after 26 seconds. Why does it take so much time? Our Extension ID is 43889. I also tried with a simple extension that doesn't do almost anything (Extension ID is 67708), and there both the alerts happen immediately. Is there a way to make the background in our extension load faster?

I'm using Internet Explorer 11 but this extension should work on all versions of Internet Explorer.


Solution

  • It would be nice if every browser provided a background scope, but unfortunately IE does not. However, we make every effort to make the code behavior as similar as possible between browsers, but we can't redefine IE's architecture. Hence, for IE we implemented our own background scope and part of its initialization requires the loading of resource files.

    Usually this is not a problem as most extension are lightweight and have few resources. However, in your case, since you have a lot of resource files in your extension, it's delaying the initial load of the background scope, but once it's loaded the alerts show in a timely manner. That's why in your test extension that has no resources, the background alert is displayed immediately.

    [Disclosure: I am a Crossrider employee]