intercept-cross-origin.html (654B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/common/get-host-info.sub.js"></script> 5 <script> 6 async_test(t => { 7 navigation.onnavigate = t.step_func_done(e => { 8 assert_true(e.cancelable); 9 assert_false(e.canIntercept); 10 assert_false(e.userInitiated); 11 assert_false(e.hashChange); 12 assert_throws_dom("SecurityError", () => e.intercept()); 13 e.preventDefault(); 14 }); 15 16 window.onload = t.step_func(() => location.href = get_host_info().HTTPS_REMOTE_ORIGIN); 17 }, "event.intercept() should throw if called for a cross origin navigation"); 18 </script>