Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>What advice do you have for trying to keep an addon compatible with both Firefox 3 and Firefox 4 at the same time?</p> </blockquote> <p>I'd recommend a single XPI for the two most recent major versions. The people on older versions are a lost case, and having two XPIs for different "active" versions is confusing (I haven't experimented recently with the way AMO presents this, but that's my old impression).</p> <blockquote> <p>What do you think about the idea of branching the code so that we have one version for 3.x and another for 4.x? We would then have to apply any new features to both versions, and test them in both versions, etc.</p> </blockquote> <p>I'd do that only if the code had become too spaghetti. As a hobbyist, I'd stop updating the older version then, leaving it around for people on older Firefox versions to use. You can see statistics for your extension on AMO to check the adoption rate of new Firefox versions (even if the stats page is not very easy to use.)</p> <blockquote> <p>In general, is it better to test for the presence of the specific feature you want (like I did with if (Application.extensions) ... or try/catch) or to just check whether Application.version starts with '3' or '4'?</p> </blockquote> <p>Capability-based branching doesn't matter here, since you're dealing with a fixed set of host applications, unlike the web pages.</p> <p>Keep in mind the possible side-effects, though:</p> <ul> <li>Checking application's version will make it harder to port to other applications, so if parts of your code are only using the platform features, not features of a specific application, it would make more sense to test the platform version.</li> <li>try..catch can also catch other errors, not related to the one you're expecting. I'd avoid it.</li> </ul> <p>P.S.</p> <p>1) To avoid CSS warnings about unknown properties (if there are lots of them), you can use different styles for different versions via <a href="https://developer.mozilla.org/en/Chrome_Registration#appversion" rel="nofollow">appversion in chrome.manifest</a></p> <p>2) I believe the Thread.processNextEvent technique to be dangerous, since it prevents the call stack from unwinding until you're done.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload