Chrome拡張で現在のタブ情報を取る方法(v3)

公式に記載のある通りだけど、 少し調べたので、メモをおいておく v3用 Promise const getCurrentTab = async () => { const queryOptions = { active: true, lastFocusedWindow: true }; // `tab` will either be a `tabs.Tab` instance or `undefined`. const [tab] = await chrome.tabs.query(queryOptions); return tab; }; Refs chrome.tabs - Chrome Developers

2023-02-25 ·  2023-02-25 · 1 分 · 43 文字