Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda