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

115
Views
¿Cómo obtener valores de chrome.storage en un bucle forEach?

Estoy creando una extensión que almacena el texto seleccionado en local y recupera ese valor y lo imprime en una lista continua. Cada vez que se selecciona y agrega el texto, se agrega a la lista de notas.

 if(note.menuItemId === "addNote") { let noteText = note.selectionText //noteText = selected note text chrome.storage.sync.set({'noteList': noteText})

Ahora, este texto seleccionado debe obtenerse del almacenamiento local e imprimirse en un formato de lista de manera que cada vez que el usuario establezca un nuevo valor, se cree un nuevo elemento de lista con ese nuevo texto.

 let textArea = document.getElementById('textArea') //textArea inside a list element chrome.storage.sync.get('noteList', function(updateNote){ let noteListArray = new Array(); list.innerHTML = ''; textArea.value = String(updateNote.noteList) noteListArray.push(textArea.value) noteListArray.forEach(function(item){ let list = document.createElement("list") let text = document.createTextNode(item) list.appendChild(text) document.getElementById("notesList").appendChild(list); })

Ahora el problema es que no puedo crear un nuevo elemento de lista. Como debo proceder en este caso.

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