TB: search-related functions in new extension API?

Talk about add-ons and extension development.
Post Reply
chconnor
Posts: 43
Joined: October 28th, 2006, 11:17 pm

TB: search-related functions in new extension API?

Post by chconnor »

Hi -- I maintain the addon "search results sort by date not relevance": https://addons.thunderbird.net/en-US/th ... src=search

It's a dead-simple overlay extension that pulls in a .js file to overwrite a single method (FacetContext.initialBuild()) in order to always sort search results by Date by default.

My understanding is that my legacy webextension will no longer work with aurora and beta versions coming down the pipe because legacy webextensions are no longer supported.

Do I further understand correctly that the new API offers no way to adjust these search results? I couldn't find anything documented, but I know basically nothing about all this.

I read in a recent thread here that I might be able to put code in something called "implementation.js" and still make it work. Are there any tutorials or guides about that? And does anyone know how I would reference FacetContext from that file?

Presumably this implementation.js trick is temporary -- where is the proper place to request API additions?

Incidentally, the related bug regarding the search order is here: https://bugzilla.mozilla.org/show_bug.cgi?id=663859 -- if anyone feels inspired to make a patch, a lot of people would be grateful. :-)

Thanks!
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: TB: search-related functions in new extension API?

Post by morat »

I would ask for help on the topicbox site.

Thunderbird addons forum
http://thunderbird.topicbox.com/groups/addons

I don't know how to override a chrome file in a Thunderbird WebExtension without the legacy API. (removed in Thunderbird 74)

chrome.manifest override
http://developer.mozilla.org/docs/Mozil ... n#override
http://developer.mozilla.org/docs/Mozil ... _overrides

Thunderbird WebExtensions APIs
http://thunderbird-webextensions.readth ... index.html

Thunderbird WebExtensions Experiments
http://thunderbird-webextensions.readth ... ments.html
http://firefox-source-docs.mozilla.org/ ... xperiments

Here is a simple implementation.js example that I believe works with Thunderbird 74 and later. (doesn't override a chrome file)

PopMailListRecipients 2 Version 1.1
http://addons.thunderbird.net/thunderbi ... /versions/
http://github.com/cleidigh/ThunderKdB/t ... ents-2/src

The newer versions use the addressBooks API and compose API, not the implementation.js file.
chconnor
Posts: 43
Joined: October 28th, 2006, 11:17 pm

Re: TB: search-related functions in new extension API?

Post by chconnor »

Thanks! I posted over there.

The question I asked there was: if this "experiments" route works for me, is it going to go away in a few versions as well? I assume that if the "experiment" is brought in to the API it won't, but if no changes are made to the API, is the "experiments" just a kind of temporary sandbox? I'm just trying to figure out if it's worth my time going to school on this or not. :-) Thanks.
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: TB: search-related functions in new extension API?

Post by morat »

I read that experiments should not be seen as a long term solution.

Comment by Magnus
http://groups.google.com/d/msg/tb-plann ... UQ-6oRCAAJ

Intent to desupport traditional addons
http://groups.google.com/forum/#!topic/ ... E8Yw6POxEE

tb-planning
http://groups.google.com/forum/#!forum/tb-planning

P.S.

Other thread over there
http://thunderbird.topicbox.com/groups/ ... 2a7c695190

Hmm, I guess option C is the only way.

Option A: convert addon to a WebExtension
Option B: convert addon to a WebExtension Experiment
Option C: integrate functionality into core
chconnor
Posts: 43
Joined: October 28th, 2006, 11:17 pm

Re: TB: search-related functions in new extension API?

Post by chconnor »

Thank you morat -- I have come to the same conclusion. I have already figured out how to do the integration; now the real work begins: figuring out how to compile TB, test it, generate a proper patch, and submit it. :-)

I'll see what I can do.
chconnor
Posts: 43
Joined: October 28th, 2006, 11:17 pm

Re: TB: search-related functions in new extension API?

Post by chconnor »

Patch submitted -- hopefully I didn't mess it up too bad. :-)
https://phabricator.services.mozilla.com/D74731
DN123ABC
Posts: 695
Joined: January 9th, 2017, 10:10 am

Re: TB: search-related functions in new extension API?

Post by DN123ABC »

So, did this work out OK for you? (us?)
chconnor
Posts: 43
Joined: October 28th, 2006, 11:17 pm

Re: TB: search-related functions in new extension API?

Post by chconnor »

Yes -- the patch was accepted and was integrated into TB. See more details at comment 14 here: https://bugzilla.mozilla.org/show_bug.cgi?id=663859
Post Reply