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

102
Views
Load event not being triggered in Firefox?

I'm working on a browser extension, and I need specific code to run when the new window is loaded. The below code works perfectly in Chrome/Edge:

window.addEventListener('load', (event) => {
  handle_data();
});

This event is never triggered in the Firefox version. Alternatively, I tried:

window.onload = handle_data;

But this is called before the DOM of the page is loaded. Any idea why this is an issue in Firefox?

EDIT: The script is executed using the following:

function open_tab() {
  chrome.tabs.create({
    url: "https://www.test.ca/apd/myad",
    active: false
  }, function (tab) {
    chrome.tabs.executeScript(tab.id, { file: "manage_content_script.js" });
  });
}

And is called on the click of the extension, using the following code in background.js:

if (msg.content == "clicked") {
      chrome.tabs.executeScript(null, { file: "dom_script.js" });
      open_tab();
    }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Have you tried DOMContentLoaded?

window.addEventListener('DOMContentLoaded', (event) => {
    console.log('DOM fully loaded and parsed');
});

See: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event

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