Labs/Ubiquity/Thunderbird

From MozillaWiki
< Labs‎ | Ubiquity
Jump to: navigation, search

Student Participation

We have several students at Seneca College, Toronto, and several more at the University of Toronto who are interested in working on this for their student projects.

If you'd like, you can edit this page and put your name, email address, the name of the class that this project will be for, and a little about what part you might be interested in working on.

Getting Set Up For Development In Thunderbird

First, download the latest nightly trunk build of Thunderbird.

Ubiquity requires Thunderbird version 3.0 or higher.

Then, make sure you have Hg (Mercurial) and Python installed, and then get yourself a working copy of the new Ubiquity-Thunderbird Hg repository by doing this command line:

 hg clone https://ubiquity.mozilla.com/hg/ubiquity-thunderbird ubiq-tbird

Figure out the path to your Thunderbird profile directory, then do:

 cd ubiq-tbird
 python manage.py install path-to-your-thunderbird-profile-directory

Start up Thunderbird and go to the Options dialog box. Go to the Advanced tab. Go to the General sub-tab of the Advanced tab. Click the "Config Editor" button. Right-click (or ctrl-click) and choose "New" -> "Boolean". Create a new boolean preference called

browser.dom.window.dump.enabled

and set it to True. This will allow dump() statements in Javascript code to output to the console, as long as you are running Thunderbird from the command line. Being able to dump() stuff to the console makes debugging a heck of a lot easier.

Source Code Organization

All of the source code for Ubiquity is currently in [[1]]. This is effectively a fork of the original code in [[2]]. For now, let's not worry about cross-compatibility: let's just get the code in ubiquity-thunderbird to the point where it works correctly in Thunderbird. After that's done, we can figure out how to merge the code lines back together into one repository and one extension that will work in both applications.

Everyone involved in the project should get very familiar with using Hg (aka Mercurial!)

Finding Tickets to Work On

We're keeping track of bugs in the same Trac repository that we're using for the main line of Ubiq-Firefox development; Thunderbird-specific tickets are marked as belonging to the "ubiquity-thunderbird" component. The saved-search link below will take you directly to the list of all Thunderbird-specific tickets:

[[3]]

User-Interface

To bring up the command input box in Thunderbird, the default key-combo is not alt-space (which was already taken, unfortunately) but rather alt+D.

Building the Extension

The same command that is used to build the XPI for Firefox still works for the Thunderbird version:

python manage.py build-xpi


Sketchy Outline of Development Plans

Search Box Integration

Besides the input-box-in-transparent-overlay UI which we're all familiar with, I'd like to try to integrate Ubiquity directly with the Thunderbird search bar which is coming soon as a part of the Thunderbird 3 beta 1 release.

We need to look at the Thunderbird code that processes keystrokes in the search bar and generates the suggestions, and figure out how to listen in on those keystrokes and inject our own command suggestions into the search bar's suggestion list.

Subscribing to Command Feeds

The Annotation service that is used in Firefox to mark bookmarked URLs as containing command feeds does not exist in Thunderbird. So for now, we just removed it, and therefore the Thunderbird version of Ubiquity simply has a hard-coded list of the standard command feeds. We'll need to come up with some other method of storing the URLs of subscribed feeds, and make it readable by both applications, so that commands you subscribe to in Firefox are available in Thunderbird. (And vice-versa? Will there perhaps be a way to subscribe to a command feed from Thunderbird, if someone emails commands to you or something?)

Inter-Process Communication

We're going to need some way for Ubiquity in Firefox and Ubiquity in Thunderbird to communicate with each other if both are running. The goal is that an "email" command launched from within Firefox should be able to send the email from Thunderbird, while a "google" command launched from within Thunderbird should be able to open the results in Firefox.

Topics to research

  1. Are there any mechanisms at a higher level than TCP/IP sockets that can be used to communicate between two running Mozilla extensions?
  2. Are there any existing open-source implementations of socket-based communcication between Mozilla extensions that we could use?
  3. How about using XML-RPC? Are there any open-source implementations of that that we could use?
  4. Could we use Weave somehow as the basis for our IPC, or if not the basis, to enhance it in some way?
  5. If Firefox is the user's active window, how can we make Thunderbird become the active window as a result of executing an "email" command? The answer to this will be platform-dependent, so we'll need to look at whether this is possible, and if so how, on Mac, Windows, and Linux.

A good place to start looking might be the extensions on addons.mozilla.org -- see if any of them are doing anything like IPC of their own.

Implementation tasks

  1. Build our own IPC mechanism (such as an XML-RPC client/server) if we can't find one already available.
  2. Test it.
  3. Integrate it with the ubiquity extension.

Modification to Existing Commands

Existing commands are going to need a new piece of metadata, probably called something like "application", to tell if they're Firefox only, Thunderbird only, or work in both (the default).

New Command Development

We should all start using Thunderbird for our daily emailing and start keeping lists of commands that would be Really Nice To Have for helping us deal with email overload.

Ideas for such commands can be added to this wiki page, right here: 1.) Rule/Filter: to create a new rule/filter for sorting mail.