Does anyone know how to detect if the iframe sandbox attribute is supported by the browser without relaying on version checks, etc?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can check whether an
iframeelement has thesandboxattribute:Side note
A good way to find feature detects is to look at Modernizr and see if it has one already. This is the Modernizr code for the sandbox attribute test:
Alternatively (if you need to use lots of feature detects in your app) include Modernizr and use it properly, instead of just getting ideas from its source!