Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (21 loc) · 1.96 KB

File metadata and controls

25 lines (21 loc) · 1.96 KB

Iframe Events

When the iframe integration is enabled, some events are triggered. These events include the following:

Event name Description
startup Fired when an iframe initializes
notification Fired when a user receives a notification
unread-changed-by-subscription Fired each time a user's subscription record changes (i.e.: unread counts, etc)
unread-changed Fired when the pages title changes
room-opened Fired when a room is opened
new-message Fired every time the opened room receives a new message
click-user-card-message Fired when the user clicks on a username link
click-mention-link Fired when the user clicks on a mention link
click-message-link Fired when the user clicks on a posted link
click-action-link Fired when the user clicks on an action link button (i.e.: "click to join" to video conferences)

Here is a sample code that listens to events fired from Rocket.Chat opened on an iframe:

window.addEventListener('message', function(e) {
    console.log(e.data.eventName); // event name
    console.log(e.data.data); // event data
});