Monday, November 3, 2008

Ubiquity in TB once again...

Alright, I finally have some time to put some more effort into the Ubiquity to Thunderbird project. Been swamped with other things recently, but I should be good to go at it some more now.

I'm considering making something along the lines of this my goal for 0.2 http://labs.toolness.com/trac/ticket/389 . Now... I don't intend to get the entire thing working. I think that's going to be extremely difficult to do, considering Justin Foong has informed me that http://labs.toolness.com/trac/ticket/325 is a pre-requisite to 389.

I've been checking out the code that's been changed recently and I think I'm going to attempt to simply get Ubiquity to pop up in Firefox again. The Thunderbird version that pops up in Thunderbird is broken in Firefox and won't show up there.

I played around with our current TB extension build to see if I could get Ubiquity to show in Firefox. Naturally, I wasn't able to do it. So I did the next best thing, process of elimination. I figure, if I can figure out which folders I need to work with to get Ubiquity to show up in Firefox, that's a good start. Our Ub-TB (calling it this to make it shorter) directory structure looks like this at the moment:

/Ubiquity
/Ubiquity/chrome
/Ubiquity/components
/Ubiquity/defaults
/Ubiquity/modules
/Ubiquity/scripts
/Ubiquity/standard-feeds

Of course there's sub directories inside of those sub directories but that's not important for now. So, I make a back up copy of the Ub-TB extension for quick/easy access. First thing I try, copy the ENTIRE Firefox Ubiquity root folder on top of Ub-TB's. Load it into Firefox, it works (but with some errors). Ok, at least it shows. Now I recopy Ub-TB over top of the modified Ub-TB and start over. I start by copying each directory over top of one another until I find a pattern that makes Ubiquity show up in Firefox.

I found out that I need to work with the following:

/Ubiquity/chrome
/Ubiquity/defaults
/Ubiquity/chrom.manifest (file)

If I copy those over, all is well. If one thing is not copied, it doesn't show up.

/Ubiquity/defaults is small, I shouldn't have a problem working with that.
Our manifest file is small, no problem there either.
/Ubiquity/chrome is massive. God help me there.

I think my next process of elimination is to simply work with /Ubiquity/chrome using the Firefox manifest file and defaults directory. Once I can get it to show up in Firefox altering chrome, I'll modify manifest and defaults to get something that works in both Firefox and TB.

At least... that's my plan. God knows if it will work, and I'm kind of short on time to do it. If it fails, I'm doomed. Oh well, I like being pressured, makes things interesting!

Thankfully, someone was kind enough to create a function that determines whether or not we're running in Firefox or Thunderbird. If worse comes to worse, I'll just litter the code with comparisons. (if app is Firefox do stuff, otherwise do Thunderbird stuff).

I'm sure this may all explode in my face and I might realize that doing everything this way is insane, but I'm not quite sure what else to do about getting Ubiquity to show in Firefox. On the other hand, someone might tell me that I'm crazy and shouldn't do it this way, so I might do something else for my 0.2... who knows. Oh well, until next time...

No comments: