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
execute javascript method calls in the background in chrome extension content script

Imagine a javascript class called MealAdvisor that keeps track of available ingredients and equipment and calculates the best possible meal that can be made with the available resources. It has methods that can be called like:

  • advisor.addSupply('egg', 12) // found some in the fowl-run
  • advisor.removeSupply('loaf', 2) // threw away some old stuff
  • advisor.removeEquipment('microwave oven', 1) // it broke

Suppose that it can sometimes take time to execute the method calls of the advisor. Instead of freezing the user interface, the calls should be queued and executed in order in the background while the user interface shows some waiting indicator and new calls can be added to the queue. Whenever the advisor has caught up and the queue is empty, it should tell the user interface so that it can show a result.

Which is the best way to modify MealAdvisor to support this? It should be usable in a content script that is added to a particular website using a chrome extension.

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