The browser window needs to be open for Yahoo! Messenger for the Web to work. If you close the browser window (or tab), you’ll get a message like this: “Are you sure you want to navigate away from this page?”
Clicking OK logs you out of Yahoo! Messenger for the Web. And if you’d rather not do that, just click Cancel.