Skip to content

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

@0xdevalias

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions