thunderbird / webext-experiments

WebExtension Experiments for Thunderbird
28 stars 12 forks source link

can web experiment apis use XPCOM #2

Closed RealRaven2000 closed 3 years ago

RealRaven2000 commented 5 years ago

I wanted to start looking into writing some code for Tb63 (I was able to successfully convert the restartless menu on top so it (mostly_ works on Thundebird 63. For my restarting ADd-ons it seems to be much more difficult (more code, I need to convert chrome,manifest) - I managed to write a manifest.json (instead of install.rdf) but my overlays do not work and there are 0 errors in the error console (Tb63b1)

Is there a utilty or documentation on what elements form install.rdf are needed in manifest,json? How does chrome.manifest have to be rewritten? Is there a optionsURL? Can we still load options in a dialog? (SmartTemplate options are context sensitive as the templates are specific to identity of currently selected folder. It would be nice to keep that context and not open the options in a tab)

If I start writing web experiment / API style stuff can the underlying API code access XPCOM? CAn this be written in JavaScript? Is it possible to implement without a working build system? The entry bar for building THunderbird in WIndows is incredibly high, I would rather pay another developer to do that part for me, but I would like a look on how it is done theoretically and write some specs for APIs I would like to call.

The other problems is that my Add-ons have many 1000 lines of code and it seems almost impossible to convert all the code in one go - which mean essentially I have to write my ADd-ons from scratch. A daunting process considering that it may be absolutely successless (APIs might not get access to the function I need, my changes may not be accepted, web extensions may be deprecated by next year if we follow the mad "invention cycle" that Mozilla goes through. I remember clearly how Firefox OS was lauded up the wazoo and then basically was dead 18 months later.

freaktechnik commented 5 years ago

For what goes in the manifest, most of https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json still applies afaik.

Experiments have to be written in JS, in fact. As the readme mentions, most of the WebExtension API development docs apply: https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/index.html - and yes, you can use XPCOM, though you're not in a JSM or an XUL window really. All you need is a Thunderbird that lets you install it, which I assume is almost any TB build compared to FF.