Using a custom XPCOM component is one way of achieving this, although
its not the only way. Assuming the other extension overlays onto
browser.xul, once you access the window object, you can access any
functions/objects that the other extension defines.
The following snippet will give you the main browser window object:
var chromeWindow =
Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
Then, assuming the other extension has an object named TabularData, and
assuming its overlayed onto browser.xul, you can access it via:
chromeWindow.TabularData
This way, you shouldn't (generally) need to alter anything in the other
extension to get this working. Which is a lot easier than creating a new
custom XPCOM component.
- Blair
On 16/11/2008 7:14 AM, Dan Brickley wrote:
> cutting this over from irc:irc.mozilla.org/ubiquity
>
>
> Hi folks. I need some ubiquity/moz clues: is there an easy way to
> wire things up so that Ubiquity can access the state of another
> running Firefox extension? Specifically I want to make a Ubiquity
> view into the http://www.w3.org/2005/ajar/tab (and we can make
> changes to tabulator to facilitate this if needed, i'm sure).
>
> I guess this would involve the extension exposing an XP-COM API?
> Something along the lines of
> https://developer.mozilla.org/en/How_to_Build_an_XPCOM_Component_in_Javascript
>
>
>
Context: the tabulator extension will scoop up and aggregate all
> kinds of interesting data as you wander around the Web. And it has
> its own HTML UI. But I'd like also to make a commandline Ubiquity
> view into the data it collects. Since this is all in-memory in .js,
> a Ubiquity script would need some API into the state of the running
> extension. From all I know about Moz, XPCOM is the only way to do
> this. Am I right in thinking that Ubiquity scripts all still have
> Chrome privileges and could therefore call any XPCOM API we expose?
>
> thanks for any pointers,
>
> cheers,
>
> Dan
>
> ps. nearby in the Web -
> http://code.google.com/p/rdfquery/wiki/RdfPlugin - same data but
> exposed through jquery-based API.
>
> -- http://danbri.org/
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---