chromium/third_party/blink/renderer/core/navigation_api/navigation.idl

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://wicg.github.io/navigation-api/
[
  Exposed=Window,
  ImplementedAs=NavigationApi
] interface Navigation : EventTarget {
  readonly attribute NavigationHistoryEntry? currentEntry;
  sequence<NavigationHistoryEntry> entries();
  [RaisesException, MeasureAs=NavigationAPI] void updateCurrentEntry(NavigationUpdateCurrentEntryOptions options);
  readonly attribute NavigationTransition? transition;
  [RuntimeEnabled=NavigationActivation] readonly attribute NavigationActivation? activation;

  readonly attribute boolean canGoBack;
  readonly attribute boolean canGoForward;

  [CallWith=ScriptState, MeasureAs=NavigationAPI] NavigationResult navigate(USVString url, optional NavigationNavigateOptions options = {});
  [CallWith=ScriptState, MeasureAs=NavigationAPI] NavigationResult reload(optional NavigationReloadOptions options = {});

  [CallWith=ScriptState, MeasureAs=NavigationAPI] NavigationResult traverseTo(DOMString key, optional NavigationOptions options = {});
  [CallWith=ScriptState, MeasureAs=NavigationAPI] NavigationResult back(optional NavigationOptions options = {});
  [CallWith=ScriptState, MeasureAs=NavigationAPI] NavigationResult forward(optional NavigationOptions options = {});

  attribute EventHandler onnavigate;
  attribute EventHandler onnavigatesuccess;
  attribute EventHandler onnavigateerror;
  attribute EventHandler oncurrententrychange;
};