公式に記載のある通りだけど、 少し調べたので、メモをおいておく

  • 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