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

164
Vistas
Webpack pack to global scope? (For manifest v3 service worker)

Manifest v3 service workers require listeners are defined in the global scope of a file, webpack compiles to inside an anonymous function. These two things seems basically incompatible. Does anyone have a solution better than ditching webpack?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There's no such requirement, it's an incorrect/inaccurate claim in the documentation: "top level of your script" is a misrepresentation of the technical terms used to describe the JS engine internals.

The actual requirement is to register the listeners in the main (synchronous) phase of the first task of the JS event loop, which may certainly happen inside a function:

(() => {
  (() => {
    chrome.runtime.onMessage.addListener(msg => { /* ..... */ });
  })();
})();
about 4 years ago · Juan Pablo Isaza Denunciar
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