sidebarAction

拡張機能のサイドバーのプロパティを取得、設定します。

サイドバー はブラウザーウィンドウのウェブページの隣の、右側か左側にあるペインです。ブラウザーはユーザーが利用できるサイドバーを見て、表示するサイドバーを選択できる UI を提供します。manifest.json の sidebar_action キーを使って、拡張機能は自身のサイドバーを定義できます。ここで述べる sidebarAction API を使って、拡張機能はサイドバーのプロパティを設定、取得できます。

sidebarAction API は browserAction API と緊密にモデリングされています。

sidebarAction API は Opera の sidebarAction API を元にしていますが、次のものはサポートされていません: setBadgeText(), getBadgeText(), setBadgeBackgroundColor(), getBadgeBackgroundColor(), onFocus, onBlur.

sidebarAction.ImageDataType

画像のピクセルデータ。ImageData オブジェクト (例えば、<canvas> 要素からのもの)でなければならない。

関数

sidebarAction.setPanel()

サイドバーのバネルを設定します。

sidebarAction.getPanel()

サイドバーのバネルを取得します。

sidebarAction.setTitle()

サイドバーのタイトルを設定します。これはブラウザーがサイドバーを一覧するあらゆる UI、例えばメニューに表示されます。

sidebarAction.getTitle()

サイドバーのタイトルを取得します。

sidebarAction.setIcon()

サイドバーのアイコンを設定します。

sidebarAction.open()

サイドバーを開きます。

sidebarAction.close()

サイドバーを閉じます。

sidebarAction.isOpen()

サイドバーが開いているか否かをチェックします。

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
sidebarAction
ImageDataType
close
getBadgeBackgroundColor
getBadgeText
getPanel
getTitle
isOpen
onBlur
onFocus
open
setBadgeBackgroundColor
setBadgeText
setIcon
The path and imageData properties of the details parameter can be set to null.
setPanel
The panel property of the details parameter can be set to null.
setTitle
The title property of the details parameter can be set to null.
toggle

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

add-ons の例

メモ: This API is based on Opera's chrome.sidebarAction API.Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.