tabs.goBack()

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

This is an asynchronous function that returns a Promise.

Syntax

var  withgoingBack = browser.tabs.goBack(
  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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaSafariFirefox for Android
goBackChrome Full support 72Edge Full support 79Firefox Full support 77Opera Full support 60Safari Full support 14Firefox Android Full support 79

Legend

Full support  
Full support

Examples

Go back to the previous page in the current tab:

function onGoBack() {
  console.log("Gone back");
}

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

var goingBack = browser.tabs.goBack();
goingBack.then(onGoBack, onError);
Acknowledgments

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

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.