Restrict all, except opening link with target _blank.
allow-modals
Restrict all, except modals like alert.
allow-same-origin
Restrict all, except AJAX request of same origin.
allow-forms
Restrict all, except form submission.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<h2>iframe allow form submit</h2>
<iframesrc="/test/form"sandbox="allow-forms">
<p>Your browser does not support iframes.</p>
</iframe>
<h2>iframe restrict all</h2>
<iframesrc="/test/form"sandbox="">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>iframe allow script</h2>
<iframesrc="/test/date"sandbox="allow-scripts">
<p>Your browser does not support iframes.</p>
</iframe>
<h2>iframe restrict all</h2>
<iframesrc="/test/date"sandbox="">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Restrict all, except opening link with target _blank.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<h2>iframe allow popups</h2>
<iframesrc="/test/popup"sandbox="allow-popups allow-scripts">
<p>Your browser does not support iframes.</p>
</iframe>
<h2>iframe Restrict all</h2>
<iframesrc="/test/popup"sandbox="">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>iframe allow modals</h2>
<iframesrc="/test/modals"sandbox="allow-modals allow-scripts">
<p>Your browser does not support iframes.</p>
</iframe>
<h2>iframe Restrict all</h2>
<iframesrc="/test/modals"sandbox="">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>iframe allow Same Origin</h2>
<iframesrc="/test/same-origin"sandbox="allow-same-origin allow-scripts">
<p>Your browser does not support iframes.</p>
</iframe>
<h2>iframe restrict all</h2>
<iframesrc="/test/same-origin"sandbox="">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>