Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!