Would `Object.keys(window.SettingsManager).length` work? Seems a bit more straightforward.