Home HTML Attributes allow HTML allow Attribute Definition
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.
Syntax
HTML Syntax <iframe allow ="feature ; feature …">
Space- or semicolon-separated feature allowlists. Syntax details follow Permissions Policy (formerly Feature Policy).
Values
Attribute Values Value Description Try it fullscreenAllow fullscreen requests from the embed Try itcamera; microphoneAllow media device features (example) Try itpaymentAllow Payment Request API usage Try it
Try it
Live Preview Inspect an iframe with an allow string. Powerful APIs still need user permission inside the embed.
Code
HTML Examples 1. fullscreen 2. camera / mic 3. payment Example 1 — Allow Fullscreen in Embed Permit an embedded player to request fullscreen.
<iframe
src="https://example.com/player"
title="Video player"
width="560" height="315"
allow="fullscreen"
loading="lazy">
</iframe> allow="fullscreen" on an iframe — open Try It Yourself.
How It Works Set allow="fullscreen" for player embeds that need it.Always set title for accessibility.Prefer allow over only allowfullscreen for modern policy.loading="lazy" for below-the-fold embeds.Example 2 — Camera and Microphone Grant media features only to trusted embeds that need them.
<iframe
src="/apps/recorder"
title="Recorder"
allow="camera; microphone"
width="640" height="360">
</iframe> How It Works List only needed features .User permission prompts still appear in the embed.Prefer same-origin trusted apps for sensitive devices.Combine with sandbox thoughtfully when locking down embeds.Example 3 — Payment Feature Allow Payment Request usage inside a checkout embed.
<iframe
src="/checkout/embed"
title="Checkout"
allow="payment"
width="420" height="640">
</iframe> allow="payment" for Payment Request embeds.
How It Works Grant payment only to checkout frames.Use HTTPS and trusted origins.Review other needed features (e.g. publickey-credentials-get).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.
Compatibility
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.
Remember
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 What does the allow attribute do? On iframe it lists Permissions Policy features the embedded document is allowed to use, such as fullscreen or camera.
Is allow the same as allowfullscreen? allowfullscreen is a legacy boolean. Prefer allow="fullscreen" (you can keep both while migrating).
Does allow grant camera without asking the user? No. It only permits the feature at the policy level; the user still must grant permission when prompted.
What if I omit allow? Many powerful features stay disallowed for cross-origin embeds by default.
Can I list multiple features? Yes — separate features in the allow string (commonly with semicolons).
How does sandbox interact? sandbox can still block capabilities even when allow lists a feature — design both together.
CODETOFUN NEWS
Stay Ahead in Tech Get the latest IT news, programming updates, and technology trends directly on your phone.
About the author Developer, cloud engineer, and technical writer
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
Helpful Share Copy link Suggestion