Closed arai-a closed 1 year ago
So, this:
const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
will no longer be appropriate/relevant?
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.
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.)
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.