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

114
Vistas
How to connect a javascript to a newly created window/document

I'm trying to make firebase-auth work in a chrome extension with manifest v3.

The biggest problem is that this code would need to run as a service worker, and as such can't access the main window for security reasons. Assuming that that will not change, I tried to modify the firebase libraries, such that on startup, I create a new Chrome window with chrome.windows.create() and then replace all calls to window in the firebase libraries with the newly created window. My current theory is that this should work (more or less, modulo service worker restarts etc). It required downloading the libraries and using webpack or rollup to create a single .js bundle.

HOWEVER: I'm currently stuck because even after chrome.windows.create(), I need to update the global javascript window and document variables (that for service workers are undefined by default). How do I go about this? The object returned from chrome.windows.create is not the same as the global javascript window, and I have no idea on how to get to document.

Sorry for the noob questions, and many thanks in advance for any help!

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