iFrames

Handle activity data that lives inside embedded frames.

When iFrames Matter

Some websites render media players or important state inside iframes. A normal presence script may not be able to read everything from the top-level page.

iFrame Data Event

The Presence API exposes an iFrameData event for integrations that need frame-level communication.

presence.on("iFrameData", async (...args) => {
  presence.info("Received iframe data")
})

Only use iframe handling when the main page cannot access the required state.

Prefer stable DOM selectors, media elements, and public page state before adding iframe logic.

Safety

Avoid collecting personal or sensitive data from frames. A presence should only send activity information that is useful for Discord Rich Presence.