tabs.Tab

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

Type

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

active

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

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

attention 省略可

boolean. タブが注目を集めているかを示します。例えば、タブがモーダルダイアログを表示したとき、attentiontrueになります。

audible 省略可

boolean. タブがミュートではないとき: タブが音を作り出すかどうかです。タブがミュートであるとき: タブがミュートでないなら、音を作り出せたかどうかです。

autoDiscardable 省略可

boolean. Whether the tab can be discarded automatically by the browser when resources are low.

cookieStoreId 省略可

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 cookies API, to set and get cookies associated with this tab's cookie store. Only present if the extension has the "cookies" permission.

discarded 省略可

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 省略可

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 省略可

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 省略可

integer. タブの ID。 タブの ID はブラウザセッショの中でユニークです。The tab ID may also be set to tabs.TAB_ID_NONE (en-US) 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 省略可

tabs.MutedInfo. The current muted state for the tab and the reason for the last state change.

openerTabId 省略可

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 非推奨

boolean. タブが選択されているかどうか。

sessionId 省略可

string. The session ID used to uniquely identify a Tab obtained from the sessions API.

status 省略可

string. loadingcomplete のどちらか。

successorId 省略可

integer タブの後継者の ID。

title 省略可

string. タブのタイトル。Only present if the extension has the "tabs" permission.

url 省略可

string. タブが表示しているドキュメントの URL。Only present if the extension has the "tabs" permission.

width 省略可

integer. タブの横幅のピクセル値。

windowId

integer. このタブのホストのウィンドウの ID。

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

ブラウザーの互換性

BCD tables only load in the browser

Example extensions

メモ: 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.