$('.chatButton').on('click', function(){
window.isClicked = 1;
});
client.on("Room.timeline", function(event, room, toStartOfTimeline) {
if(!window.isClicked) return;
console.log("(%s) %s :: %s", room.name, event.getSender(), event.getContent().body);
});
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.