</div>
<pre id="test">
<script class="testbody" type="text/javascript"> variframe = document.getElementById("iframe"),
attr = iframe.sandbox;
// Security enforcement tests for iframe sandbox are in test_iframe_*
function eq(a, b) {
// check if two attributes are qual modulo permutation
return ((a+'').split(" ").sort()+'') == ((b+'').split(" ").sort()+'');
}
ok(attr instanceof DOMTokenList, "Iframe sandbox attribute is instace of DOMTokenList");
ok(eq(attr, "allow-scripts") &&
eq(iframe.getAttribute("sandbox"), "allow-scripts"), "Stringyfied sandbox attribute is same as that of the DOM element");
ok(attr.contains("allow-scripts") && !attr.contains("allow-same-origin"), "Set membership of attribute elements is ok");
attr.add("allow-same-origin");
ok(attr.contains("allow-scripts") && attr.contains("allow-same-origin"), "Attribute contains added atom");
ok(eq(attr, "allow-scripts allow-same-origin") &&
eq(iframe.getAttribute("sandbox"), "allow-scripts allow-same-origin"), "Stringyfied attribute with new atom is correct");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.