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

103
Vistas
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 Respuestas
Responde la pregunta

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 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