Use matchmedia for questions related to programmatic discovery of API support for various media features in the runtime environment of a web browser.
I'm making use of matchMedia().addListener to detect dark/light mode theme preference changes in Safari, however in WebStorm using …
javascript addeventlistener matchmedia