We're requesting the development of a public API that allows us to efficiently check the status of the Media Viewer extension using something like an mw.mv API. Currently, there is a need for a more straightforward way to access this information without relying on fragile conditions.
Here's how the API could be used in JavaScript with the mw.mv API:
/** * Get the Media Viewer preferences from mw.mv API. * * @return {boolean} Media Viewer Preferences */ function getMediaViewerSettings() { return mw.mv ? mw.mv.isEnabled() : false; } # TODO [x] Create new API [] use it in WikimediaEvents