Skip to content

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

Description

@0xdevalias
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',
  })
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions