Why usage of "sdk/system/events" warned?

I’m getting validation warning message, every time when I upload my add-on to AMO.

Usage of low-level or non-SDK interface

Warning: Your add-on uses an interface which bypasses the high-level protections of the add-on SDK. This interface should be avoided, and its use may significantly complicate your review process.

const events = require(“sdk/system/events”);

Why usage of “sdk/system/events” warned?
If I should avoid to use this api, is there any alternative for it?

system/events - Mozilla | MDN

1 Like

The changes that were allowed to low-level APIs versus high-level APIs were much bigger (back when there was a lot of changes every Firefox release). This meant that relying on low-level APIs could break your extension. However these days using most of the low-level APIs is a fairly safe bet - at least for the ones that don’t break with e10s. And sdk/system/events will not break with e10s.

Thanks!
Then I want to know the reason why it’s marked and warned.
sdk/system/events is the only one (in the low level APIs which I use in my add-on) that is warned.
Is it by design?
Or a bug maybe?

One of the reasons it is warned is because, as I already explained, low-level modules are considered unstable, even if that is not the case anymore in practice.

Further the warning is helpful for reviewers to see, where you use potentially sensitive APIs (not to say you can do bad stuff using just the high-level APIs).

Plus it is an API for an XPCOM concept, which may eventually be deprecated.

Thanks, got it!!