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

113
Views
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
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!