tabs.goForward()

Navigate to the next page in tab's history, if available.

This is an asynchronous function that returns a Promise.

Syntax

js
let goingForward = browser.tabs.goForward(
  tabId,                       // optional integer
  callback                       // optional function
)

Parameters

tabId Optional

integer. The ID of the tab to navigate. Defaults to the active tab of the current window.

callback Optional

function. When the page navigation finishes, this function is called without parameters.

Return value

A Promise that is fulfilled when the page navigation finishes.

Examples

Go forward to the next page in the current tab:

js
function onGoForward() {
  console.log("Gone forward");
}

function onError(error) {
  console.log(`Error: ${error}`);
}

let goingForward = browser.tabs.goForward();
goingForward.then(onGoForward, onError);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
goForward
Chrome – Full support
Chrome 72 (Release date: 2019-01-29)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 77 (Release date: 2020-06-02)
footnote Full support
Opera – Full support
Opera 60 (Release date: 2019-04-09)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Note: This API is based on Chromium's chrome.tabs API. This documentation is derived from tabs.json in the Chromium code.