send-after-setting-document-domain-window-2.htm (928B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: send() with document.domain set: loading documents from the origin document.domain was set to should throw</title> 5 <script src="send-after-setting-document-domain-window-helper.js"></script> 6 <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol[1]/li[2]/ol[1]/li[3]" /> 7 </head> 8 <body> 9 <script> 10 run_test(function() { 11 document.domain = document.domain.replace(/^\w+\./, ""); 12 var client = new XMLHttpRequest(); 13 client.open("GET", location.protocol + "//" + document.domain + location.pathname.replace(/[^\/]*$/, "") + "status.py?content=hello3", false); 14 assert_throws_dom("NetworkError", function() { 15 client.send(null); 16 }); 17 }, "loading documents from the origin document.domain was set to should throw"); 18 </script> 19 </body> 20 </html>