send-non-same-origin.htm (1046B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: send() - non same-origin</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <base> 8 </head> 9 <body> 10 <div id="log"></div> 11 <script src="/common/get-host-info.sub.js"></script> 12 <script> 13 // Setting base URL before running the tests 14 var host_info = get_host_info(); 15 document.getElementsByTagName("base")[0].setAttribute("href", host_info.HTTP_REMOTE_ORIGIN); 16 17 function url(url) { 18 test(function() { 19 var client = new XMLHttpRequest() 20 client.open("GET", url, false) 21 assert_throws_dom("NetworkError", function() { client.send() }) 22 }, document.title + " (" + url + ")") 23 } 24 url("mailto:test@example.org") 25 url("tel:+31600000000") 26 url(host_info.HTTP_REMOTE_ORIGIN) 27 url("javascript:alert('FAIL')") 28 url("folder.txt") 29 url("about:blank") 30 url("blob:bogusidentifier") 31 </script> 32 </body> 33 </html>