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

134
Vistas
Tab in undefined when Chrome Extension console is opened and focused

I have this function :

async getCurrentTab() {
    let queryOptions = { active: true, currentWindow: true };
    let [tab] = await chrome.tabs.query(queryOptions);
    console.log("current tab: " + tab);
    return tab;
}

which is triggered this way :

chrome.tabs.onUpdated.addListener(changePageHandler);
    async function changePageHandler(tabId, changeInfo) {
        if (changeInfo.status == 'complete') {
            getCurrentTab();
        }
    }

My problem is that when i focus the Chrome Console window (click or just CMD+TAB to it) and then refresh the web page i get this :

current tab: undefined

But if I click on the webpage and refresh or just close the Chrome Console window i get this :

current tab: [object Object]

Which means (I think) that it has been recognized, can somebody explain to me what is going on please ?

Thanks !

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