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

194
Vistas
Call an async function from within a blocking chrome.webRequest.onBeforeRequest handler?

I have a Chrome Extension which has an chrome.webRequest.onBeforeRequest handler, with ["requestBody", "blocking"] params.

I want to call an async function inside the background script from within this handler.

Currently I use chrome.tabs.sendMessage to pass a message to the content script which then receives it and sends a message to the background using chrome.extension.sendMessage, which receives it and calls the said async function.

Both the background & content script are using chrome.runtime.onMessage to listen to those messages.

This feels like a pretty messy workaround - I guess I don't need the content script to act as proxy.
Can I trigger an async function from within the onBeforeRequest handler directly?

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