Timofei, I posted this in an earlier
thread<http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/d067d81ce27703a6/51167122cb1aad04#51167122cb1aad04>if
it's at all useful...

For what it's worth this is my solution to the upcoming 0.5 release.  It's
certainly not elegant, but it works, and it means I don't have the hassle of
managing two versions of the commands whilst people migrate.

var isParser2 = function(){
var prefs = Components.classes["@mozilla.org/preferences-service;1
"].getService(Components.interfaces.nsIPrefService);
 var branch = prefs.getBranch("extensions.ubiquity.");

return (branch.getPrefType("parserVersion") != 0) ?
branch.getIntPref("parserVersion") == 2 : false;
}

if (isParser2()) {

/* Parser 2 version of the CmdUtils.CreateCommand calls here */
 /* ... */

} else {

/* Parser 1 version of the CmdUtils.CreateCommand calls here */
 /* ... */

}

(Full code is here:
http://github.com/garyhodgson/ubiquity-rtm-api/blob/7299e60eab828fa89d76ce3c927faa1ad4064a23/ubiquity-rtm-api.js
)


Cheers,
Gary

2009/7/8 Timofei Shatrov <[email protected]>

>
> This is very interesting, but I still can't find the answer to the
> question: how does a third-party command developer ensure that it
> works for every user after update? Many of the users will be using
> 0.5, while others will be stuck with 0.1.9. How do I make my commands
> work for both groups of people flawlessly?
>
> On 8 июл, 01:18, Aza <[email protected]> wrote:
> > http://www.azarask.in/blog/post/ubiquity-05-conondrum/
> >
> > -- aza | ɐzɐ --
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to