Source code
Revision control
Copy as Markdown
Other Tools
/* -*- 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,
*
* The origin of this IDL file is
*/
[Func="Navigation::IsAPIEnabled", Exposed=Window]
interface Navigation : EventTarget {
sequence<NavigationHistoryEntry> entries();
readonly attribute NavigationHistoryEntry? currentEntry;
[Throws] undefined updateCurrentEntry(NavigationUpdateCurrentEntryOptions options);
readonly attribute NavigationTransition? transition;
readonly attribute NavigationActivation? activation;
readonly attribute boolean canGoBack;
readonly attribute boolean canGoForward;
NavigationResult navigate(USVString url, optional NavigationNavigateOptions options = {});
NavigationResult reload(optional NavigationReloadOptions options = {});
NavigationResult traverseTo(DOMString key, optional NavigationOptions options = {});
NavigationResult back(optional NavigationOptions options = {});
NavigationResult forward(optional NavigationOptions options = {});
attribute EventHandler onnavigate;
attribute EventHandler onnavigatesuccess;
attribute EventHandler onnavigateerror;
attribute EventHandler oncurrententrychange;
};
dictionary NavigationUpdateCurrentEntryOptions {
required any state;
};
dictionary NavigationOptions {
any info;
};
dictionary NavigationNavigateOptions : NavigationOptions {
any state;
NavigationHistoryBehavior history = "auto";
};
dictionary NavigationReloadOptions : NavigationOptions {
any state;
};
dictionary NavigationResult {
Promise<NavigationHistoryEntry> committed;
Promise<NavigationHistoryEntry> finished;
};
enum NavigationHistoryBehavior {
"auto",
"push",
"replace"
};
enum NavigationType {
"push",
"replace",
"reload",
"traverse"
};