Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Estoy tratando de analizar todas las URL de las pestañas que tengo abiertas

Estoy tratando de copiar las direcciones URL de todas las pestañas abiertas con javascript y luego poner las direcciones URL en un área de texto html, sin embargo, no funciona. Este es mi código.

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

Tenga en cuenta que esta es una extensión de Google Chrome, ¡hágame saber cómo puedo solucionar esto!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su código está modificando una copia del valor del elemento, no el elemento en sí.
Debe reemplazar el text += con textArea.value +=

PD El código se puede acortar:

 chrome.tabs.query({}, tabs => { document.getElementById("thing").value = tabs.map(t => t.url).join('\n'); });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!