eyalroz / removedupes

Remove Duplicate Messages
https://addons.thunderbird.net/en-US/thunderbird/addon/removedupes/
Other
88 stars 6 forks source link

Update addon-developer-support #169

Closed arai-a closed 1 year ago

arai-a commented 1 year ago

Services.jsm is planned to be removed in Firefox 117 cycle in https://bugzilla.mozilla.org/show_bug.cgi?id=1780695 . The latest addon-developer-support source reflects the change.

eyalroz commented 1 year ago

So, this:

const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;

will no longer be appropriate/relevant?

arai-a commented 1 year ago

Services.jsm exports Services object, but the Services object is already available as global variable in recent versions:

The declaration var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services; is to support both before/after versions.

In the patch's case, it's WebExtensions API, and Services is available from 88. And given this extensions's strict_min_version is 91.0, the import isn't performed in any case.

If a code needs to support only after version, no declaration is necessary and you can just write Services to get the Services object. The patched file is a copy of addon-developer-support, which tries to support both before/after versions, so the declaration is still there.

eyalroz commented 1 year ago

Thanks for the explanation - and for the MR. Merging...

(now if I could only manage to get the toolbar menubutton to appear again I could probably make the next release.)