0

I'm curious how various websites use the console.log() function to be always located at the bottom, just like Facebook and Discord. Once the console is opened, my function should follow any previous/new console messages and be shown underneeth them.

Bella
  • 104
  • 17

1 Answers1

1

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.');
});

This could also be triggered when the window is resized, meaning that it would be better to use console.log() than alert().

Bella
  • 104
  • 17
ethry
  • 731
  • 6
  • 17