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

222
Visualizações
How to debug unknown html + js: How to trace what .js is modding html for a specific class?

I am maintaining a web site that does some magic behavior (well, it adds a few characters that are not in the html) to elements tagged:

class="popupover-host"

I can't find this referenced in the css, and so far don't see it referenced in any .js

In the browser, it is pre rendered, and examining the element shows me the fully processed text (e.g. the text that is in the source html PLUS the added characters).

I feel like I need to watch the browser process the html, but have not done this before.

The question boils down to this (I think):

Static html + css can be figured out "by hand" by mapping the "class" tags in the html to the relevant css. We know the browser bolts the two together at render time. Add js to the picture, and it gets... harder to figure out how the final html was created.

And with nested css... it is also hard to figure out.

Question:

  1. So, how do I watch the browser bolt it all together?

  2. For example, if I know the "class" that is being modified, how can I see where the modifications come from? (css and/or js)

  3. Is there a way to either: a) Have the browser tell me the things that have modified the contents of this class, or b) run a "debugger" with a watch on the class in question, to see what the browser applies to the contents of that class?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

OK, I found the way to figure out which js is tweaking this element.

These steps are for Chrome on Windows.

First, find the element name. Right click on the rendered html word that is being modified and select Inspect Element.

Look at the DOM and find the class that is specific to this element. In this case it is:

class="popupover-host"

(I then search the whole html source to be sure that this class is specific to only the modified text in question.)

Now, open Developer Tools (F12) and hit Ctrl+Shift+F

Paste: popupover-host

Into the search box and run the search.

In my case, I got three hits:

  • The js (that I had not found by a hand trace)
  • The css (which I had found by had, but the modification of interest was not there)
  • The source html (which I already knew about)

The js had the modification:

return i.innerHTML = "*" + i.innerHTML

Aha! Now I know why the rendered html includes an * character that is not in the source html nor is it done by the css!

about 4 years ago · Juan Pablo Isaza Relatório
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