48. What is the purpose of the sandbox attribute on iframe?
The iframe sandbox attribute applies restrictions to the embedded document. Individual capabilities can be selectively enabled using sandbox tokens. It is a useful defense-in-depth mechanism when embedding content that should operate with limited privileges.
Key Takeaways
- sandbox provides restrictions for embedded content.
- Only grant required capabilities.
Knowledge Check
What is sandbox primarily used for?