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

269
Vistas
Get the file name where a JavaScript Object has been defined using JS only (no dev tool)

Let's imagine we visit a random website where N javascript files are loaded:

- file1.js
- file2.js
- file3.js
...
- fileN.js

We have the following global variable of type Object window.myObject

The question is: is there a way to get the file name where window.myObject has been defined?

I know this can be done using the browser's dev tools, but I would like to have a function that does this for me.

Where I'm at: I feel like there might be a way to add a setter to window.myObject, to add a test property, and to console.trace() via the setter, but I'm not advanced enough to understand how exactly (and to even know if this is doable).

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