5 views
How will the website loaded in the iframe get the conference name or ID?
Asked at
AI answer
The conference ID is usually passed explicitly to the page inside the iframe—for example, as a URL parameter (/conference?id=123) or via postMessage. For data that should not appear in the URL, it is preferable to send a message from the parent page or have the server retrieve the data using an authenticated session.
When using postMessage, validate event.origin and the message structure, and have the sender specify an exact targetOrigin rather than *:
iframe.contentWindow.postMessage(
{ type: "conference:init", conferenceId: "123" },
"https://conference.example.com"
);
The iframe page itself should accept messages only from a trusted origin. The passed ID must not be treated as proof of access rights—the server must verify the user's authorization separately.
Also asked at Т-Банк
- What are the differences between static Promise methods: Promise.all, Promise.allSettled, Promise.race, Promise.any?
- What potential security threats does this application have and how to protect against them?
- [name] asked: tell us about your work experience, why you decided to leave your current job, and what you expect from the new place?
- What utility types in TypeScript do you know and which ones do you use most often?
- Break down the application according to the Feature-Sliced Design (FSD) architecture — describe the layers App, Pages, Widgets, Features, Entities.
Similar questions
- How can the user interface be embedded on a conference website? What alternatives to an iframe are there?
- How will the iframe work after it is embedded: what page will it display, and what happens in the user interface?
- How can the appearance of the interface embedded via an iframe be controlled—for example, the colors and button sizes for different conferences?
- When a WebSocket connection is established, how will the server know which conference's questions the user needs? Where will the client get the conference ID?
- How will users at one conference receive only new questions for their conference via WebSocket, without seeing questions from another conference?