intercept-on-synthetic-event.html (588B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script> 5 async_test(t => { 6 // We need to grab an NavigationDestination to construct the event. 7 navigation.onnavigate = t.step_func_done(e => { 8 const event = new NavigateEvent("navigate", { 9 destination: e.destination, 10 signal: (new AbortController()).signal 11 }); 12 13 assert_throws_dom("SecurityError", () => event.intercept()); 14 }); 15 history.pushState(1, null, "#1"); 16 }, "event.intercept() throws if invoked on a synthetic event"); 17 </script>