Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to see how many tabs/windows currently open #14

Open
0xdevalias opened this issue Nov 21, 2023 · 0 comments
Open

Ability to see how many tabs/windows currently open #14

0xdevalias opened this issue Nov 21, 2023 · 0 comments
Labels

Comments

@0xdevalias
Copy link
Owner

chrome.action.onClicked.addListener(async () => {
  const tabs = await chrome.tabs.query({ windowType: 'normal' }).then((t) => t.length)
  const windows = await chrome.windows.getAll().then((w) => w.length)
  let message = `You have ${tabs} tab${tabs > 1 ? 's' : ''} open`

  if (windows > 1) message += ` across ${windows} windows`

  chrome.notifications.create({
      type: 'basic',
      title: 'Tabs count',
      message,
      iconUrl: '/icons/icon-144x144.png',
  })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant