tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

NavigateEvent.webidl (1971B)


      1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 * You can obtain one at http://mozilla.org/MPL/2.0/.
      5 *
      6 * The origin of this IDL file is
      7 * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigateevent
      8 */
      9 
     10 [Func="Navigation::IsAPIEnabled", Exposed=Window]
     11 interface NavigateEvent : Event {
     12  constructor(DOMString type, NavigateEventInit eventInitDict);
     13 
     14  readonly attribute NavigationType navigationType;
     15  readonly attribute NavigationDestination destination;
     16  readonly attribute boolean canIntercept;
     17  readonly attribute boolean userInitiated;
     18  readonly attribute boolean hashChange;
     19  readonly attribute AbortSignal signal;
     20  readonly attribute FormData? formData;
     21  readonly attribute DOMString? downloadRequest;
     22  readonly attribute any info;
     23  readonly attribute boolean hasUAVisualTransition;
     24  readonly attribute Element? sourceElement;
     25 
     26  [Throws] undefined intercept(optional NavigationInterceptOptions options = {});
     27  [Throws] undefined scroll();
     28 };
     29 
     30 dictionary NavigateEventInit : EventInit {
     31  NavigationType navigationType = "push";
     32  required NavigationDestination destination;
     33  boolean canIntercept = false;
     34  boolean userInitiated = false;
     35  boolean hashChange = false;
     36  required AbortSignal signal;
     37  FormData? formData = null;
     38  DOMString? downloadRequest = null;
     39  any info;
     40  boolean hasUAVisualTransition = false;
     41  Element? sourceElement = null;
     42 };
     43 
     44 dictionary NavigationInterceptOptions {
     45  NavigationPrecommitHandler precommitHandler;
     46  NavigationInterceptHandler handler;
     47  NavigationFocusReset focusReset;
     48  NavigationScrollBehavior scroll;
     49 };
     50 
     51 enum NavigationFocusReset {
     52  "after-transition",
     53  "manual"
     54 };
     55 
     56 enum NavigationScrollBehavior {
     57  "after-transition",
     58  "manual"
     59 };
     60 
     61 callback NavigationInterceptHandler = Promise<undefined> ();