windows
ブラウザーウィンドウと相互作用します。この API を使って開いているウィンドウの情報を取得したり、ウィンドウを開き、修正し、閉じることができます。ウィンドウのオープン、クローズ、アクティベートのイベントをリッスンすることもできます。
型
windows.WindowType
ブラウザーウィンドウの this の型。
windows.WindowState
ブラウザーウィンドウの状態。
windows.Window
ブラウザーウィンドウについての情報を含む。
windows.CreateType
作成するブラウザーウィンドウの型を指定する。
定数
windows.WINDOW_ID_NONE
ブラウザーウィンドウがないことを表す
windowId
の値。windows.WINDOW_ID_CURRENT
現在のウィンドウを表す
windowId
の値。
メソッド
windows.get()
与えられた ID のウィンドウの詳細を取得します。
windows.getCurrent()
現在のウィンドウを取得します。
windows.getLastFocused()
最も最近フォーカスされたウィンドウを取得します — 典型的には「最上位」のウィンドウです。
windows.getAll()
すべてのウィンドウを取得します。
windows.create()
新しいウィンドウを作成します。
windows.update()
ウィンドウのプロパティを更新します。これを使ってウィンドウの移動、リサイズ、フォーカス(外し)などを行います。
windows.remove()
ウィンドウと、そのタブのすべてを閉じます。
イベント
windows.onCreated
ウィンドウが作成された時に発火します。
windows.onRemoved
ウィンドウが閉じられた時に発火します。
windows.onFocusChanged
現在フォーカスされているウィンドウが変わった時に発火します。
ブラウザーの互換性
Example extensions
- annotate-page
- bookmark-it
- private-browsing-theme
- store-collected-images
- theme-integrated-sidebar
- window-manipulator
メモ:This API is based on Chromium'schrome.windows
API. This documentation is derived fromwindows.json
in the Chromium code.