--- title: tabs.Tab slug: Mozilla/Add-ons/WebExtensions/API/tabs/Tab translation_of: Mozilla/Add-ons/WebExtensions/API/tabs/Tab ---
{{AddonSidebar()}}

tabs.Tab型はタブについての情報を含んでいます。これはタブの中のコンテンツについての情報へのアクセスを提供します。例えば、コンテンツはどれくらいの大きさか、どのような特別な状態もしくは制限が有効になっているか、など。

Type

この型の値はオブジェクトです。以下のプロパティを含みます:

active

boolean. タブがウィンドウ内でアクティブかどうかを示します。タブのウィンドウがフォーカスされていない場合でも当てはまります。

アクティブなタブは通常一つ検出されます。しかしながら、Firefox for Android上では、拡張機能のポップアップが新しいタブの中で開かれます。このポップアップタブが検出されたとき、アクティブなタブはポップアップが開かれたタブに代えられます。

attention {{optional_inline}}
boolean. タブが注目を集めているかを示します。例えば、タブがモーダルダイアログを表示したとき、attentiontrueになります。
audible {{optional_inline}}
boolean. タブがミュートではないとき: タブが音を作り出すかどうかです。タブがミュートであるとき: タブがミュートでないなら、音を作り出せたかどうかです。
autoDiscardable {{optional_inline}}
boolean. Whether the tab can be discarded automatically by the browser when resources are low.
cookieStoreId {{optional_inline}}
string. タブのクッキーストア。If different tabs can have different cookie stores (for example, to support contextual identity), you can pass this as the storeId option into various methods of the {{WebExtAPIRef("cookies")}} API, to set and get cookies associated with this tab's cookie store. Only present if the extension has the "cookies" permission.
discarded {{optional_inline}}
boolean. タブが破棄されたか。 A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated.
favIconUrl {{optional_inline}}
string. タブのfaviconのURL。Only present if the extension has the "tabs" permission. It may also be an empty string if the tab is loading.
height {{optional_inline}}
integer. タブの高さのピクセル値。
hidden
boolean. タブが隠されている(非表示)かどうか。
highlighted

boolean. タブがハイライトされているかどうかどうか。 An active tab is always highlighted, but some browsers may allow additional tabs to be highlighted, for example by clicking them while holding Ctrl or ⌘ Command keys.

Firefox for Android doesn't support highlighting multiple tabs, and Firefox desktop requires the browser.tabs.multiselect preference.

id {{optional_inline}}
integer. タブのID。 タブのIDはブラウザセッショの中でユニークです。The tab ID may also be set to {{WebExtAPIRef('tabs.TAB_ID_NONE')}} for browser windows that don't host content tabs (for example, devtools windows).
incognito
boolean. タブがプライベートブラウジングウィンドウの中にあるかどうか。
index
integer. 0を底としたウィンドウの中のタブのインデックス。
isArticle
boolean. Trueならrendered in Reader Modeで閲覧可能、falseならそれ以外。
isInReaderMode
boolean. Trueならrendered in Reader Modeで閲覧中、falseならそれ以外。
lastAccessed
double. タブが最後にアクセスされた時刻(単位: milliseconds since the epoch)。
mutedInfo {{optional_inline}}
{{WebExtAPIRef('tabs.MutedInfo')}}. The current muted state for the tab and the reason for the last state change.
openerTabId {{optional_inline}}
integer. The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists.
pinned
boolean. タブがピン留めされているかどうか。
selected {{deprecated_inline}}
boolean. タブが選択されているかどうか。
sessionId {{optional_inline}}
string. The session ID used to uniquely identify a Tab obtained from the {{WebExtAPIRef('sessions')}} API.
status {{optional_inline}}
string. loadingcomplete のどちらか。
successorId {{optional_inline}}
integer タブの後継者のID。
title {{optional_inline}}
string. タブのタイトル。Only present if the extension has the "tabs" permission.
url {{optional_inline}}
string. タブが表示しているドキュメントのURL。Only present if the extension has the "tabs" permission.
width {{optional_inline}}
integer. タブの横幅のピクセル値。
windowId
integer. このタブのホストのウィンドウのID。

Note: In extension background scripts, the only properties that are available are tabId and windowId.

Browser compatibility

{{Compat("webextensions.api.tabs.Tab", 10)}}

{{WebExtExamples}}

Acknowledgements

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.