tabs.goForward()
Navigate to the next page in tab's history, if available.
This is an asynchronous function that returns a Promise.
Syntax
let goingForward = browser.tabs.goForward( tabId, // optional integer callback // optional function )
Parameters
-
tabIdOptional -
integer. The ID of the tab to navigate. Defaults to the active tab of the current window. -
callbackOptional -
function. When the page navigation finishes, this function is called without parameters.
Return value
A Promise that is fulfilled when the page navigation finishes.
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 | |
goForward |
72 | 79 | 77 | ? | 60 | 14 | ? | ? | 79 | ? | 15 | ? |
Examples
Go forward to the next page in the current tab:
function onGoForward() { console.log("Gone forward"); } function onError(error) { console.log(`Error: ${error}`); } let goingForward = browser.tabs.goForward(); goingForward.then(onGoForward, onError);
Note: This API is based on Chromium's chrome.tabs API. This documentation is derived from tabs.json in the Chromium code.
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/goForward