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

91
Views
Leer la variable de almacenamiento secuencialmente en una extensión de Chrome

Aquí está mi código en un script de contenido, con MV3:

 var checkVariable; chrome.storage.sync.get('mykey', function(result) { checkVariable = result.mykey; alert ("1: " + checkVariable); }); alert ("2: " + checkVariable); if (checkVariable === true) { // Various stuff }

El segundo mensaje de alerta se ejecuta primero y devuelve indefinido, luego la primera alerta se ejecuta y devuelve el valor correcto. El problema es que la condición if también se ejecuta antes de recuperar el valor correcto del almacenamiento.

¿Cuál es la manera de ejecutar esto secuencialmente?

about 4 years ago · Santiago Trujillo
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!