Search Docs…

Search Docs…

Guide

Game Switching

Game Switching via postMessage (Options only)

For Turbo / HighLow / SpreadX, keep the same iFrame and send a message from the parent page to the iFrame window.

Parent → iFrame

const iframe = document.getElementById('ts-game');
iframe.contentWindow.postMessage(
  { type: 'gameSelect', payload: 'gameSelectedTurbo' },
  'https://trading.<yourbrand>.com'
);

Payload values - gameSelectedTurbo - gameSelectedHL - (Ask TS for SpreadX value if not gameSelectedSpreadX)

Security - Always set targetOrigin to exact iFrame origin. - In the iFrame app, validate event.origin.

Two iFrames relay pattern If you host two sibling iFrames, use the parent as a relay to forward messages between them (see sample in appendix).

1000x switch - Switching to or from 1000x requires a new Step‑1/2/3 cycle against the FX base and updating the iFrame src.