Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
Delete group tab with javascript

I want to delete a group tab using JavaScript.

I have the current tab id, and with that i get the current group tab id (if the current tab is not in a group tab it returns -1).

Now I wonder if there is something like this :

chrome.tabs.remove(tabId)

but for the group tab, so more like :

chrome.tabGroups.remove(groupId).

Here's my code if it helps :

chrome.tabs.query({ active: true, currentWindow: true }, async function (tabs) {
    console.log(tabs[0].id, tabs[0].groupId);
    let currentTab = tabs[0].id;
    let currentGroupId = tabs[0].groupId;

    //get all the infos about the group
    let infos = await chrome.tabGroups.get(tabs[0].groupId);
  }
);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use chrome.tabs.query to find the tabs with the same groupId and then call chrome.tabs.remove with an array of these tabs' ids:

async function closeGroup() {
  const [tab] = await chrome.tabs.query({active: true, currentWindow: true});
  const groupTabs = await chrome.tabs.query({groupId: tab.groupId});
  await chrome.tabs.remove(groupTabs.map(t => t.id));
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda