Skip to Content
Platform.Ontology

Embed another page in an iframe

A page can show another site inside a frame unless that site blocks framing.

Works without askingScreen and windowsEmbeddingWeb browsersWhile you use it

In one line

Can show another site inside its own page, unless that site blocks it

A page can show another site inside a frame unless that site blocks framing.

A site can embed a third party page (maps, video, ads, payment forms) and, if it frames you without protection, overlay invisible content for clickjacking. Framing headers and sandbox settings control who can do this.

What it can and can't do

What the user does: You open a page that includes a map, video or payment box.

It can

  • Show another site's content in a frame, such as a video, map or payment form
  • Limit what the frame may do with sandbox settings
  • Pass a few messages back and forth with the frame

It cannot

  • Embed sites that tell browsers not to allow framing
  • See what you type or click inside the other site
  • Use your camera, microphone or location inside the frame unless the page allows it

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported122015-07-29None
FirefoxSupported12004-11-09None
SafariSupported42009-06-08None
Safari on iPhoneSupported3.22010-04-03All iOS browsers use WebKit
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

API<iframe src sandbox allow>; Content-Security-Policy: frame-ancestors; X-Frame-Options
Browser compat keyshtml.elements.iframe
http.headers.Content-Security-Policy.frame-ancestors
http.headers.X-Frame-Options
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsWhile the frame is on the page; the framed site's own cookies may be blocked as third party
How to take it backNothing to revoke (no permission is stored)
Inside an iframeThis is the iframe boundary: allow attribute lists permissions, sandbox restricts scripts, popups, forms and top navigation

Typical flow

  1. Page adds an iframe element
  2. Browser checks the target's frame-ancestors or X-Frame-Options
  3. If allowed, content loads with sandbox and allow limits
  4. Parent cannot read the frame cross-origin

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • frame-ancestors overrides X-Frame-Options when both are present in browsers that support it
  • Cross-origin frames cannot read each other's DOM; only postMessage crosses
  • Third party cookies in frames are blocked by default in Safari and Firefox, and partitioned or limited in Chrome
  • Top-level navigation from a sandboxed frame needs allow-top-navigation (or allow-top-navigation-by-user-activation)
  • The parent cannot hide the framed page's own permission prompts or make them look like its own

The story

What it is

A page can show another website inside a frame, unless that site says no.

For you

You see a video, map, chat box, ad or payment form that looks like part of the page. It is really another site running inside a box.

For makers

Embedding lets small teams add maps, videos and payments with one line. Ad and measurement companies rely on it. It also lets another site watch you from inside the page.

Where you see it

TypeExampleApps
videoA blog shows a YouTube video inside its own page without hosting a single file.YouTube
paymentsA shop shows the card form from its payment company so the shop never touches card numbers.Stripe
adsAn ad network draws each ad inside a frame so ad code cannot touch the page.Google Ad Manager
gamesA game portal runs each game in a frame and shares one ad slot and leaderboard.Poki, CrazyGames, itch.io
productivityA company wiki embeds a live Figma file or Google Doc.Notion, Figma
securityA scam page hides a bank or social button under a fake one so you click it by mistake. This is called clickjacking.None named
enterpriseA support widget loads chat inside a frame on every page.Intercom

Risks

  • Clickjacking
  • Third party tracking from frames

What the platform says

  • MDN: iframe element. Documents how a page can embed another page inside a frame and how sites can control it.

Good uses and abuse

Legitimate uses

  • Maps, video and payment widgets
  • Embedded ads
  • Embedded apps and widgets

Known abuse

  • Clickjacking
  • Invisible frames for tracking pixels
  • Cross-origin phishing overlays

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility5 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2010-01, Chrome 4: X-Frame-Options supported to stop clickjacking
  • 2015-01, Chrome 40: CSP frame-ancestors supported
  • 2018-01, Firefox 58: CSP frame-ancestors supported in Firefox

Sources

How well checked: Based on official documentation.

On this page