MozillaZine


TB: search-related functions in new extension API?

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

Post Posted May 7th, 2020, 4:03 pm

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: 4488
Joined: February 3rd, 2009, 6:29 pm

Post Posted May 8th, 2020, 8:56 am

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/Mozilla/Chrome_Registration#override
http://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/manifest.json/chrome_url_overrides

Thunderbird WebExtensions APIs
http://thunderbird-webextensions.readthedocs.io/en/latest/index.html

Thunderbird WebExtensions Experiments
http://thunderbird-webextensions.readthedocs.io/en/latest/how-to/experiments.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/thunderbird/addon/986522/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: 42
Joined: October 28th, 2006, 11:17 pm

Post Posted May 8th, 2020, 6:14 pm

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: 4488
Joined: February 3rd, 2009, 6:29 pm

Post Posted May 9th, 2020, 7:43 am

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

Comment by Magnus
http://groups.google.com/d/msg/tb-planning/-E8Yw6POxEE/bDUQ-6oRCAAJ

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

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

P.S.

Other thread over there
http://thunderbird.topicbox.com/groups/addons/Te5e54f2a7c695190

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: 42
Joined: October 28th, 2006, 11:17 pm

Post Posted May 9th, 2020, 11:40 am

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: 42
Joined: October 28th, 2006, 11:17 pm

Post Posted May 11th, 2020, 1:20 pm

Patch submitted -- hopefully I didn't mess it up too bad. :-)
https://phabricator.services.mozilla.com/D74731

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest