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

96
Views
¿Cómo puedo borrar storage.sync para mi extensión de Chrome?

Tengo una pequeña extensión de Chrome que construí usando chrome.storage.sync api para almacenar en caché los datos ingresados por el usuario. Sin embargo, cuando el usuario ejecuta una operación de eliminación, los datos persisten en el área de almacenamiento, incluso después de ejecutar sync.remove y sync.clear. ¿Me falta algo?

 chrome.storage.sync.get('tasks', function(obj) { //assign tasks array to variable var tasks = obj.hasOwnProperty('tasks') ? obj.tasks : []; chrome.storage.sync.remove('tasks': liValue); chrome.storage.sync.clear(); //find and remove deleted task from array, checking against cached li text value //liValue is cached textnode value prior to dom deletion for(var j = 0; j < tasks.length; j++) { if(tasks[j] == liValue) { tasks.splice(j, 1); alert("splicing " + tasks[j] + "!!!"); } } //reset tasks in storage chrome.storage.sync.set({'tasks': tasks}, function() { if (chrome.runtime.lastError) console.log(chrome.runtime.lastError); else console.log("Tasks saved successfully"); }); });

Revisé los documentosaquí y lo mejor que puedo decir es que estoy usando las firmas del método correctamente. Alguien describió un problema similar en esta publicación de SO, pero aplicar el mismo código no parece resolver mi problema.

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!