iframe Sandbox Tokens
Every keyword token for the iframe sandbox attribute — the thirteen defined in the HTML Living Standard plus allow-storage-access-by-user-activation, defined by the Storage Access API. When the sandbox attribute is present without any tokens the iframe runs in the most restrictive mode; each allow-* token listed here selectively re-enables a specific browser capability for the embedded content.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/iframe-sandbox-tokens.json
Or use as a typed import:
import { iframeSandboxTokens } from "https://staticdata.dev/v1/iframe-sandbox-tokens.ts"
Formats
- JSON 2.8 KB
/v1/iframe-sandbox-tokens.json
min: 2.5 KB · /v1/iframe-sandbox-tokens.min.json
- CSV 2.2 KB
/v1/iframe-sandbox-tokens.csv
- TypeScript 3.0 KB
/v1/iframe-sandbox-tokens.ts
export const iframeSandboxTokens
type SandboxToken = (typeof iframeSandboxTokens)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| token | string | The sandbox keyword token as used in the HTML attribute value | allow-scripts |
| description | string | What capability the token grants when added to the sandbox attribute | Allows the embedded page to run scripts. |
Preview
First 10 records.
| token | description |
|---|---|
| allow-downloads | Allows the embedded browsing context to trigger file downloads. Without this token, download-initiating navigations are blocked. |
| allow-forms | Allows the embedded page to submit forms. Without this token, form submissions are blocked. |
| allow-modals | Allows the embedded page to open modal windows via alert(), confirm(), prompt(), and the beforeunload event dialog. |
| allow-orientation-lock | Allows the embedded page to lock the screen orientation using the Screen Orientation API. |
| allow-pointer-lock | Allows the embedded page to use the Pointer Lock API to capture mouse movement. |
| allow-popups | Allows the embedded page to open new browsing contexts via window.open() or target="_blank" links. Without this token, such operations silently fail. |
| allow-popups-to-escape-sandbox | Allows popups opened by the sandboxed page to escape the sandbox — the new browsing context does not inherit the sandbox restrictions. |
| allow-presentation | Allows the embedded page to start a presentation session using the Presentation API. |
| allow-same-origin | Allows the content to be treated as being from its actual origin rather than a unique opaque origin. Without this token, the iframe's content is always treated as cross-origin, blocking access to same-origin cookies, storage, and the parent document. |
| allow-scripts | Allows the embedded page to run scripts (but not create popups). Without this token, all scripting is disabled. |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/iframe-sandbox-tokens.json | jq '.[0]' import type { SandboxToken } from "https://staticdata.dev/v1/iframe-sandbox-tokens.ts";
const res = await fetch("https://staticdata.dev/v1/iframe-sandbox-tokens.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const iframeSandboxTokens: SandboxToken[] = await res.json();
console.log(iframeSandboxTokens[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/iframe-sandbox-tokens.min.json") as r:
iframeSandboxTokens = json.load(r)
print(iframeSandboxTokens[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/iframe-sandbox-tokens.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/iframe-sandbox-tokens.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
The tokens in this dataset are sourced from the HTML Living Standard maintained by WHATWG. The sandbox attribute on <iframe> imposes a set of restrictions on the embedded content by default; each allow-* token in this dataset selectively lifts one of those restrictions. When no tokens are present the iframe is maximally sandboxed — scripts, forms, popups, and same-origin access are all disabled. Tokens are space-separated and may be combined freely.
Developers most commonly reach for allow-scripts (to run JavaScript) and allow-same-origin (to preserve the content’s origin for storage and cookie access), but combining both of these tokens negates much of the sandbox’s security benefit because a script can then remove the sandbox entirely. The dataset covers all tokens in the HTML Living Standard as of October 2026, including newer additions such as allow-downloads and allow-top-navigation-to-custom-protocols, plus allow-storage-access-by-user-activation, which is defined by the Storage Access API rather than HTML.
Non-standard or browser-proprietary extensions to the sandbox token set are not included. Token availability may vary slightly across browser versions; the descriptions reflect the normative specification semantics. This dataset is equivalent in scope to the token list accepted by the CSP sandbox document directive, which mirrors the <iframe> sandbox attribute.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
iframe-sandbox-tokens changelog for this dataset's history.
Related datasets
More Web datasets
- aria-attributes
- aria-roles
- character-encodings
- credit-card-types
- dns-record-types
- dom-events
- emoji
- emoji-shortcodes
- html-entities
- html-attributes
- input-types
- http-auth-schemes
- http-cache-directives
- http-content-codings
- http-headers
- http-methods
- http-status-codes
- http-versions
- ip-protocol-numbers
- keyboard-event-codes
- link-relations
- media-type-suffixes
- mime-types
- oauth-grant-types
- ports
- referrer-policies
- ip-special-blocks
- svg-elements
- tcp-flags
- tlds
- tls-cipher-suites
- tls-versions
- uri-schemes
- well-known-uris