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

127
Vistas
I'm trying to parse all the urls of the tabs I have open

I'm trying to copy the url's of all the open tabs with javascript and then put the urls into a html textarea, however it's not working. This is my code.

            chrome.windows.getCurrent({"populate":true}, function(currentWindow) {
               var tabURLs = [];
               var tabs = currentWindow.tabs;
               for (var i=0; i<tabs.length; i++) {
                   tabURLs.push(tabs[i].url);
               }
               var textArea = document.getElementById("thing");
               var text = textArea.value;
               tabURLs.forEach(item => text += item);
            });
        };

Keep in mind this is a google chrome extension, let me know how I can fix this!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your code is modifying a copy of the element's value, not the element itself.
You need to replace text += with textArea.value +=

P.S. The code can be shortened:

chrome.tabs.query({}, tabs => {
  document.getElementById("thing").value = tabs.map(t => t.url).join('\n');
});
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