FirefoxのWeb Extensionsでタブを開く時にウインドウを指定して開く方法。
browser.tabs.create で windowId プロパティで指定することでウインドウを指定してタブを作成する事ができる。
指定しない場合はアクティブなウィンドウ?最後にフォーカスしたウィンドウに作成される。
let creating = browser.tabs.create({ active : true, windowId : targetWindowId, url : targetUrl });
ちなみに windowId は tab 情報などのプロパティから取得可能。
![](https://dev.macha795.com/wp-content/uploads/cocoon-resources/blog-card-cache/adec6b7fe735d4bf667370b32e75dcc6.png)
tabs.Tab - Mozilla | MDN
The type tabs.Tab contains information about a tab. This provides access to information about what content is in the tab, how large the content is, what special...
コメント