简体   繁体   中英

How to create an extension for Thunderbird/Lightning

I had to create an extension for contacts import into Thunderbird. This part is done, now I need to import tasks. But tasks/calendar are not handled by default in thunderbird, so I need Lightning. Here is my problem. I have no idea if I can detect an other extension and use some of its features.

Easiest way to detect Lightning is checking whether its interfaces are defined, eg:

if ("calICalendar" in Components.interfaces)
  alert("Lightning is installed!");

Using its features is a different thing - depends on what you are trying to do. For most things importing Lightning's modules and using them should do:

Components.utils.import("resource://calendar/modules/calUtils.jsm");
alert(cal.getCalendarManager().getCalendars());

I don't think it is properly documented however, you will have to look at the source code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM