Administrator

How do I keep idle timeout updated in iframes?

Coding required

This is an API task that requires coding and should be done by a content developer with that knowledge.

Idle Timeout Keep Alive

Custom Buzz integrations that are hosted in iframes, including custom Main Menu entries, custom top-level toolbar buttons, and SCOs, cannot accurately update the idle timeout. To enable this, Buzz supports a postMessage API that allows these integrations to reset the idle timeout.

Implementing the Custom iframe

When an end user interacts with the keyboard or mouse, the custom iframe should call the postMessage JavaScript method passing ResetIdle as the message name. (See the PostMessage Calls section for more details about constructing the message). You should call this message in response to both the mousemove and keydown events on the iframe window. You may also call this message while the user is otherwise interacting with the iframe, such as watching a video. Buzz performs the idle check on a one minute interval. So, you may debounce your call to postMessage to happen only once each minute.

PostMessage Calls

Since Buzz and the custom integrations are hosted on different domains, we use the postMessage API to communicate between Buzz and the custom iframe. The custom iframe calls postMessage on the top-level window using window.top.postMessage with the target origin of ‘*’.

This table summarizes the messages that the keep alive API defines:

Name Originator Data Description
ResetIdle
Custom iframe {“name”: “ResetIdle”}
Custom iframe posts this when the user has interacted in the iframe with the keybouard or the mouse. 

You can set window.logCustomMessages = true from the browser console to log all messages to the console.

forum

Have a question or feedback? Let us know over in Discussions!