windows

ブラウザーウィンドウと相互作用します。この API を使って開いているウィンドウの情報を取得したり、ウィンドウを開き、修正し、閉じることができます。ウィンドウのオープン、クローズ、アクティベートのイベントをリッスンすることもできます。

windows.WindowType

ブラウザーウィンドウの this の型。

windows.WindowState

ブラウザーウィンドウの状態。

windows.Window (en-US)

ブラウザーウィンドウについての情報を含む。

windows.CreateType (en-US)

作成するブラウザーウィンドウの型を指定する。

定数

windows.WINDOW_ID_NONE (en-US)

ブラウザーウィンドウがないことを表す windowId の値。

windows.WINDOW_ID_CURRENT (en-US)

現在のウィンドウを表す windowId の値。

メソッド

windows.get() (en-US)

与えられた ID のウィンドウの詳細を取得します。

windows.getCurrent() (en-US)

現在のウィンドウを取得します。

windows.getLastFocused() (en-US)

最も最近フォーカスされたウィンドウを取得します — 典型的には「最上位」のウィンドウです。

windows.getAll() (en-US)

すべてのウィンドウを取得します。

windows.create() (en-US)

新しいウィンドウを作成します。

windows.update() (en-US)

ウィンドウのプロパティを更新します。これを使ってウィンドウの移動、リサイズ、フォーカス(外し)などを行います。

windows.remove() (en-US)

ウィンドウと、そのタブのすべてを閉じます。

イベント

windows.onCreated (en-US)

ウィンドウが作成された時に発火します。

windows.onRemoved (en-US)

ウィンドウが閉じられた時に発火します。

windows.onFocusChanged (en-US)

現在フォーカスされているウィンドウが変わった時に発火します。

ブラウザーの互換性

BCD tables only load in the browser

Example extensions

メモ: This API is based on Chromium's chrome.windows API. This documentation is derived from windows.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.