HTML allow Attribute

Beginner
6 min read
Updated: Nov 2026
3 examples
Live preview

Definition and Usage

The allow attribute on <iframe> lists Permissions Policy features the embedded document may use — for example camera, microphone, geolocation, fullscreen, and payment.

It replaces older one-off flags for many capabilities. Prefer allow="fullscreen" (and related directives) over relying only on legacy allowfullscreen.

Permissions Policy for embeds.

The parent page decides which powerful features a cross-origin iframe may request.

Least privilege.

Only grant features the embed actually needs. Empty or omitted allow keeps the default restrictive policy for many features.

HTML Syntax

syntax.html
<iframe allow ="feature; feature …">

Space- or semicolon-separated feature allowlists. Syntax details follow Permissions Policy (formerly Feature Policy).

Attribute Values

ValueDescriptionTry it
fullscreenAllow fullscreen requests from the embedTry it
camera; microphoneAllow media device features (example)Try it
paymentAllow Payment Request API usageTry it

Live Preview

Inspect an iframe with an allow string. Powerful APIs still need user permission inside the embed.

Updates the iframe allow attribute. Feature availability still depends on origin and user gestures.

Result

allow="fullscreen"

HTML Examples

Example 1 — Allow Fullscreen in Embed

Permit an embedded player to request fullscreen.

HTML
<iframe
  src="https://example.com/player"
  title="Video player"
  width="560" height="315"
  allow="fullscreen"
  loading="lazy">
</iframe>
Try It Yourself

How It Works

  1. Set allow="fullscreen" for player embeds that need it.
  2. Always set title for accessibility.
  3. Prefer allow over only allowfullscreen for modern policy.
  4. loading="lazy" for below-the-fold embeds.

Example 2 — Camera and Microphone

Grant media features only to trusted embeds that need them.

HTML
<iframe
  src="/apps/recorder"
  title="Recorder"
  allow="camera; microphone"
  width="640" height="360">
</iframe>
Try It Yourself

How It Works

  1. List only needed features.
  2. User permission prompts still appear in the embed.
  3. Prefer same-origin trusted apps for sensitive devices.
  4. Combine with sandbox thoughtfully when locking down embeds.

Example 3 — Payment Feature

Allow Payment Request usage inside a checkout embed.

HTML
<iframe
  src="/checkout/embed"
  title="Checkout"
  allow="payment"
  width="420" height="640">
</iframe>
Try It Yourself

How It Works

  1. Grant payment only to checkout frames.
  2. Use HTTPS and trusted origins.
  3. Review other needed features (e.g. publickey-credentials-get).
  4. Document the policy for your security review.

Edge Cases & Pitfalls

allow is a parent-imposed ceiling — the embed still needs permission and secure context.

legacy

allowfullscreen still exists

Legacy boolean; prefer allow="fullscreen" for new pages, or set both during migration.

sandbox

sandbox interacts

Sandbox flags can block features even if allow lists them.

origin

Cross-origin limits

Some features need explicit origins in the policy string.

empty

Omit unused features

Do not copy a huge allow list from unrelated embeds.

Browser Support

allow is an HTML attribute for browsers. It is not a Node.js, Deno, or Bun API.

✓ Widely available

allow

Permissions Policy via iframe allow is supported in modern browsers.

93% Global support (approx.)
Google Chrome Yes
Full support
Mozilla Firefox Yes
Full support
Apple Safari Yes
Full support
Microsoft Edge Yes
Full support
Opera Yes
Full support
Samsung Internet Yes
Full support
Internet Explorer No support
Not supported
allow Widely supported

Bottom line: Grant the minimum features each iframe needs; prefer allow over legacy flags.

Key Takeaways

  • Role: Permissions Policy feature list for iframes.
  • Examples: fullscreen, camera, microphone, payment.
  • Least privilege: only what the embed needs.
  • Modern: prefer allow="fullscreen" over allowfullscreen alone.

One line: allow lists which powerful features an iframe may use.

Frequently Asked Questions

On iframe it lists Permissions Policy features the embedded document is allowed to use, such as fullscreen or camera.
allowfullscreen is a legacy boolean. Prefer allow="fullscreen" (you can keep both while migrating).
No. It only permits the feature at the policy level; the user still must grant permission when prompted.
Many powerful features stay disallowed for cross-origin embeds by default.
Yes — separate features in the allow string (commonly with semicolons).
sandbox can still block capabilities even when allow lists a feature — design both together.

Next: allowfullscreen

Legacy boolean fullscreen permission on iframe embeds.

allowfullscreen tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful