Navigation: canGoForward property
The canGoForward
read-only property of the Navigation
interface returns true
if it is possible to navigate forwards in the navigation history (i.e. the currentEntry
is not the last one in the history entry list), and false
if it is not.
Value
A boolean value:true
if it is possible to navigate forwards in the navigation history, false
otherwise.
Examples
async function backHandler() {
if (navigation.canGoBack) {
await navigation.back().finished;
} else {
displayBanner("You are on the first page");
}
}
async function forwardHandler() {
if (navigation.canGoForward) {
await navigation.forward().finished;
} else {
displayBanner("You are on the last page");
}
}
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
canGoForward |
102 |
102 |
No |
No |
88 |
No |
102 |
102 |
No |
70 |
No |
19.0 |
See also