このロケールの翻訳が存在しないため、英語バージョンのコンテンツを表示しています。 Help us translate this article!

Get a tabs.Tab containing information about the tab that this script is running in.

You can call this function in contexts where there is a browser tab, such as an options page. If you call it from a background script or a popup, it will return undefined.

This is an asynchronous function that returns a Promise.


var gettingCurrent = browser.tabs.getCurrent()



Return value

A Promise that will be fulfilled with a tabs.Tab object containing information about the current tab. If any error occurs the promise will be rejected with an error message.


Get information about the current tab:

function onGot(tabInfo) {

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

var gettingCurrent = browser.tabs.getCurrent();
gettingCurrent.then(onGot, onError);

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxOperaFirefox for Android
getCurrentChrome Full support YesEdge Full support 14Firefox Full support 45Opera Full support YesFirefox Android Full support 54


Full support  
Full support

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.