/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigateevent */ [Func="Navigation::IsAPIEnabled", Exposed=Window] interface NavigateEvent : Event { constructor(DOMString type, NavigateEventInit eventInitDict); readonly attribute NavigationType navigationType; readonly attribute NavigationDestination destination; readonly attribute boolean canIntercept; readonly attribute boolean userInitiated; readonly attribute boolean hashChange; readonly attribute AbortSignal signal; readonly attribute FormData? formData; readonly attribute DOMString? downloadRequest; readonly attribute any info; readonly attribute boolean hasUAVisualTransition; readonly attribute Element? sourceElement; [Throws] undefined intercept(optional NavigationInterceptOptions options = {}); [Throws] undefined scroll(); }; dictionary NavigateEventInit : EventInit { NavigationType navigationType = "push"; required NavigationDestination destination; boolean canIntercept = false; boolean userInitiated = false; boolean hashChange = false; required AbortSignal signal; FormData? formData = null; DOMString? downloadRequest = null; any info; boolean hasUAVisualTransition = false; Element? sourceElement = null; }; dictionary NavigationInterceptOptions { NavigationInterceptHandler handler; NavigationFocusReset focusReset; NavigationScrollBehavior scroll; }; enum NavigationFocusReset { "after-transition", "manual" }; enum NavigationScrollBehavior { "after-transition", "manual" }; callback NavigationInterceptHandler = Promise ();