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

159
Visualizações
How to add listener whether the function do if user open web browser's console

I'm working on React, but I want to execute the function only if the user open the web browser's console. I don't know that should I use the window.addEventListener or something else that like useEffect() that has a empty dependency array but run when user open web browser's console instead.

Is the React has an event listener that detect if user open the web browser's console.

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

0

Sir, There a simple way of doing this would be to check when the window is resized. Since you can't check the console without resizing the page, it would work (this works with both horizontal and vertical dev tools)

window.addEventListener('resize', function () {
  console.log('You resized this window or accessed the console.');
});
about 4 years ago · Juan Pablo Isaza Relatório

0

If an event listener is added to an EventTarget from inside another listener — that is, during the processing of the event — that event will not trigger the new listener. However, the new listener may be triggered during a later stage of event flow, such as during the bubbling phase.

addEventListener(type, listener);
addEventListener(type, listener, options);
addEventListener(type, listener, useCapture);
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