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

116
Vistas
How can I check if a tab has been created and get the number of tabs currently open?

I'm trying to make a chrome extension that closes any tab that's created after a certain amount of tabs (for testing I've set it to 1) has already been opened.

I tried using chrome.tabs.onCreated.addListener( but I'm not sure why it's not working.

As for checking the number of tabs currently open, I've come across chrome.tabs.query() but I'm not quite sure how to use it.

let tabsCount;

chrome.tabs.onCreated.addListener(function(tab){

    //get number of tabs??

    
    if (tabsCount > 3) {
        window.closeTab()
    }

});
about 4 years ago · Juan Pablo Isaza
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