Closed Bug 1468667 Opened 2 years ago Closed Last year

Get WebExtensions working in Thunderbird

Categories

(Thunderbird :: Add-Ons: Extensions API, enhancement)

enhancement
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 63.0

People

(Reporter: darktrojan, Assigned: darktrojan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

I know there are other bugs about this topic, but I wanted to start with a clean slate since the code I'm writing is new.

Currently to run even the most basic webextension in Thunderbird throws some errors due to bits missing. It also prevents Thunderbird from closing properly. I intend to fix that in this bug and get some added bonuses along the way.
Two of the tests are still failing for reasons I'm yet to figure out, but we might as well run them anyway.
Bug 1455471 seems to do the same and has a r? patch too.
(In reply to Geoff Lankow (:darktrojan) from comment #0)
> I know there are other bugs about this topic, but I wanted to start with a
> clean slate since the code I'm writing is new.

Great to see you working on this! However, Philipp has already submitted a patch for review in bug 1455471. Would you mind checking his rather large patch.

I can see that an M-C patch that removes |skip-if = appname == "thunderbird"|. You need an M-C reviewer for that, I suggest Kris (:kmag) or Andrew (:aswan). Also, there are a few subtests disabled with |AppConstants.MOZ_APP_NAME == "thunderbird"|
https://searchfox.org/mozilla-central/search?q=AppConstants.MOZ_APP_NAME+%3D%3D+%22thunderbird%22&case=false&regexp=true&path=
so maybe they will work now, too.

I really have no expertise in this field, so you you please direct the reviews to either Philipp and/or Magnus and the M-C person.

Looking at try, test_theme_update.js is fixed by bug 1468018. Were you pushing from C-C tip?

Further looking at the try I can see that you tried to include an M-C piece and pushed with --buildbot. That's no longer the approved method, and I thought it didn't work at all any more.

What you do instead is to push the M-C changes to M-C's try without any jobs, then modify .taskcluster.yml to point to try and that revision, as can be seen here:
https://hg.mozilla.org/try-comm-central/rev/3f77333b11d7e0c1ec0aebcca96a43720d12666f#l1.14
It's also documented here:
https://wiki.mozilla.org/ReleaseEngineering/ThunderbirdTryServer#For_TaskCluster_builds
For the record: I had a patch for switching certain tests back on (attachment 8918600 [details] [diff] [review]), but I'm sure this is covered here much better now.
Attachment #8985295 - Attachment is obsolete: true
Attachment #8985295 - Flags: review?(jorgk)
There's a whole bunch more tests in toolkit/components/extensions that I didn't know about. I've managed to skip enough broken ones that a test run on my machine passes, but I'm getting vastly different results on try. Still trying to figure out what's going on…
Attachment #8985292 - Flags: review?(jorgk)
Attachment #8985293 - Flags: review?(jorgk)
Attachment #8985293 - Attachment is obsolete: true
Attachment #8985292 - Flags: review?(philipp)
Attachment #8985721 - Flags: review?(kmaglione+bmo)
It's amazing what you can think of at 2am, when you've spent all day trying to think of it.
(In reply to Geoff Lankow (:darktrojan) from comment #8)
> Still trying to figure out what's going on…
You've added MOZ_ADDON_SIGNING=1 to your .mozconfig since this is what the server builds use since bug 1468018, right?
Yes, that was an issue, but it wasn't *the* issue. I (eventually) realised that the .manifest file I added wasn't being packaged, but of course on my machine the tests don't use the packaged code.
Comment on attachment 8985292 [details]
Bug 1468667 - [webext] Add missing pieces to allow WebExtensions to run without error

https://reviewboard.mozilla.org/r/250908/#review257606

Hey Geoff, thanks for looking into this! Lets chat about WebExtensions, I have some prior work that would be interesting. For this patch, I'd suggest to steal the review from Magnus on bug 1455471 and add anything that I may have missed. The patch implements most of the tabs and windows API functions needed to get the basic functionality running. I may have done some minor work on top locally, but I think the most exciting thing was moving a few files around to match with what m-c did in the meanwhile.

What is next on my list is the legacy extensions loader, which is also almost complete. I'm going to continue with that on the plane back tomorrow. I'm happy to hand that off to you if I don't get done, this way we can make some progress.

As a next goal, I'd like to get the gecko profiler running, which will require moving some m-c files into toolkit for the geckoProfiler API, the browserAction API, and optionally also the commands API. This will enable florian to report some performance issues in TB :)

I have a patch lined up for a WebExtensions API for the cloudfile/filelink API, which makes it pretty easy to use. In addition to that, I'd like to set things up so that the community can support us with experimental APIs, which means setting up some Thunderbird-specific guidelines to extend https://webextensions-experiments.readthedocs.io/ that define what kinds of APIs we'd welcome and which we should not. As a next step, we should involve the community in some brainstorming to find out what APIs would be of general use.

Lets chat about this via IRC or possibly a meeting, depending on availibility. Setting r- for now for lack of choices in MozReview, looking forward to your input in bug 1455471.
Attachment #8985292 - Flags: review?(philipp) → review-
Depends on: 1469238
Blocks: webext-tb
Attachment #8985292 - Attachment is obsolete: true
Kris, can this be reviewed any time soon?
Comment on attachment 8985721 [details]
Bug 1468667 - [webext] Enable webextensions tests for Thunderbird

https://reviewboard.mozilla.org/r/251264/#review268146
Attachment #8985721 - Flags: review?(aswan) → review+
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/integration/autoland/rev/163742dd3235
[webext] Enable webextensions tests for Thunderbird r=aswan
https://hg.mozilla.org/mozilla-central/rev/163742dd3235
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 63.0
Depends on: 1487008
Component: General → Add-Ons: Extensions API
You need to log in before you can comment on or make changes to this bug.