~/talk

Nuances of Iframe: Lessons from Contentstack Live Preview

Talkat React India 2024 · 2024-10-15..10-19· [web-platform, security]
links:none on file
slides:none on file

Contentstack Live Preview loads any hosted site into an iframe and syncs CMS edits in real time using websockets for the prototype, then moves to a per-session channel ID (uuid) to isolate users. Direct window access fails on cross-origin pages so the implementation switches to the postMessage API (or post-robot) to send the preview hash and commands; sandbox and frame-ancestors CSP protect embedding, intersection observer mitigates clickjacking, and a surprising gotcha is that browser history is one linear history mixing iframe and parent navigation.

AI-written summary · about

  1. 0:00Introduction to live preview
  2. 1:06Building first live preview
  3. 3:10Syncing website changes in real time
  4. 4:55Channel ID for user separation
  5. 7:06Iframe security and clickjacking
  6. 9:12Preventing clickjacking with Intersection Observer
  7. 11:17Cross-origin iframe access error
  8. 12:42Solving with postMessage API
  9. 14:09Iframe in RTE for security
  10. 15:35Implementing navigation in iframe
  11. 17:44Browser history with iframes
  12. 20:33Sandboxing for iframe security
  13. 21:15Closing remarks and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.