Is it possible to make app lab close itself (close the tab)?

Is it possible to make app lab close itself (close the tab)? I was making a private live chat app and I want them to click a button telling the chat that the leave. But when they press the button. It announces it to the chat that they left. Then they have to close the tab anyway. So no one does that. Is there a way to do that?

While it is possible in a standard Javascript environment, it is not possible in App Lab. You could have a table with a record for each user, and a column for the last time they were online. It wouldn’t announce it to the public, but you could make a list of online users by making a filter that checks for online users:

readRecords("OnlineUsers", {}, function (records) {
  var valid = records.filter(function (entry) {return (typeof entry.time == number)});
  var online = valid.filter(function (entry) {return (getTime()-entry.time < 5000)});
  // You can then show the list of online users in a textarea, or in some sort of prompt
});