Qeole / colorediffs

Thunderbird extension to colorize code diffs in messages.
Mozilla Public License 2.0
24 stars 5 forks source link

Compatibility with Thunderbird 78+ #93

Closed marxin closed 3 years ago

marxin commented 3 years ago

I've just updated to the latest ThunderBird release and the extension does not work. It's properly loaded.

Qeole commented 3 years ago

Thanks for the report, I am (painfully) aware of that. TB 78 only supports WebExtensions, and the add-on is not compatible at all. I have been looking at porting the code, but the API does not currently allow to modify the message displayed (here is the related bug).

The only alternative at the moment is to create a so-called experiment (design the relevant API ourselves), but it looks far from trivial, and I have neither the knowledge of Thunderbird internals nor the time to do so, especially if the result has to get ditched in a few versions because add-on frameworks change again (maintaining add-ons for TB/Firefox has been painful over the last years).

So here are the possibilities:

Thanks again for opening the issue! I hope you can find a workaround until this gets solved :/.

marxin commented 3 years ago

Thank you very much for the explanation. My feeling is that there are quite some folks in the bug that are affected by the missing API. That said, I hope they'll add something in the near future.

Anyway, thanks for working on that.

carlosfrodriguez commented 3 years ago

Hi @Qeole it seams that there is some work already done in the mentioned bug, I hope you can port this amazing useful ad-on to TB 78+

Qeole commented 3 years ago

Correct, there is a new messageDisplayScripts API. And there is also work already done on my side, with a working add-on! :)

It's not completely ready, I'm still missing some UI bit to deactivate/reactivate colouring or white-spaces replacement from the message panel (it works from the option page). I'll probably push a branch sometimes this weekend.

For the record I might have kept most portions of the code, but some needed rewriting and instead I chose to redo it from scratch and go with a different approach. The new version won't parse and rewrite the diff in the message, instead it injects a lib from highlight.js that just changes the colours on the relevant lines. We lose a bit of precision, we entirely lose the different modes (unified/context/side-by-side), but it should hopefully handle some cases more gracefully (and be easier to maintain). Whitespace replacement still here, although I'll probably skip line numbers.

The API landed in v82 (currently alpha/Earlybird), meaning it will be available to most people in the stable v88. But I asked on the bug tracker, and there is also a good chance that it gets backported to v78.4. The new version of the add-on should be compatible with whatever version has the API.

I'll keep you posted when I have something publishable.

Qeole commented 3 years ago

Please see related draft PR for trial/feedback, or if you need a quick replacement (note that it currently needs Thunderbird 82, Earlybird for now - download it from here, select “Nightly”).