I want to query Echo from a gadget to see if there is a pending notification. I first tried by using .hasClass('mw-badge-important'), but that is not reliable as the class is added after my gadget has run. Is there a callback I can call, or am I forced to use the API? Also, what does the "web interface" entail?
Topic on Talk:Notifications
To answer my own question: mw.echo.overlay.notificationCount.