Nope, no reason at all that I wouldn't recommend the builtIn=true
approach; I should've mentioned it in my original response, actually.
:) Thanks for asking, though!
- Atul
On 1/12/09 2:46 PM, Edwin Khodabakchian wrote:
> Atul,
> Thanks again for the pointer. I have an initial version of the bridge
> between feedly and ubiquity up and running. Looking through the code,
> I saw that there is a way to add a feed just for the duration of the
> browser session. This approach simplifies lifecycle from our
> perspective because if the user disables or un-installs the feedly
> extension, it will automatically remove the command by preventing the
> extension to install them. Is there any reason you would recommend
> against that builtIn=true approach?
>
> Thank you,
> Edwin
>
> Here is what the resulting source code looks like:
> ///////////////////////////////////////
> // Registration of Ubiquity Commands //
> ///////////////////////////////////////
>
> function getExtensionDir() {
> var extMgr = Components.classes["@mozilla.org/extensions/manager;
> 1"]
> .getService
> (Components.interfaces.nsIExtensionManager);
> return extMgr.getInstallLocation( "fee...@devhd" ).getItemLocation
> ( "fee...@devhd" );
> }
>
> function getBaseUri() {
> var ioSvc = Components.classes["@mozilla.org/network/io-service;
> 1"]
>
> .getService(Components.interfaces.nsIIOService);
> var extDir = getExtensionDir();
> var baseUri = ioSvc.newFileURI(extDir).spec;
> return baseUri;
> }
>
> function installUbiquityCommands()
> {
> var url = getBaseUri() + "content/app/ubiquity/commands.js"
>
> var jsm = {};
> Components.utils.import("resource://ubiquity/modules/setup.js",
> jsm);
>
>
> jsm.UbiquitySetup.createServices().feedManager.addSubscribedFeed( {
> url: url,
> sourceUrl: url,
> canAutoUpdate: true,
> isBuiltIn: true
> } );
> }
>
>
>
> On Jan 12, 9:25 am, Atul Varma<[email protected]> wrote:
>
>> Hi Edwin,
>>
>> Right now the easiest way to do this with 0.2pre is to obtain the feed
>> manager from Ubiquity and use it to subscribe to a new feed for the
>> user. This will probably go something like:
>>
>> var jsm = {};
>> Components.utils.import("resource://ubiquity/modules/setup.js", jsm);
>> jsm.UbiquitySetup.feedManager.addSubscribedFeed(feedInfo);
>>
>> For the 'feedInfo' parameter above, take a look at the code for
>> 'installDefaults()' in default_feed_plugin.js. Let me know if you have
>> any other questions... We'll probably provide a cleaner API for this
>> soon too, I imagine.
>>
>> - Atul
>>
>> On 1/12/09 9:12 AM, Edwin Khodabakchian wrote:
>>
>>
>>> Hi, My name is Edwin Khodabakchian. I am one of the contributors to
>>> the feedly project. I am currently exploring integrating feedly with
>>> Ubiquity and I have a question: is there an internal API for a firefox
>>> extension to programmatically register a command? I am going to take a
>>> look at the source but I through I might ask first.
>>> Thank you. -Edwin
>>>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---