Jump to content

Append at the end in console


Alwaysmore

Recommended Posts

Hi all, 

Quick question please. When the script is processing, each time there is "log.info" or "log.sucess" or whatever displayed in the console, it appears at the end BUT I have to scroll down each time to see the end...

You see what I mean ?

Any idea ?

Thanks a lot. 

Link to comment
Share on other sites

  • 1 month later...

If the output is longer than. One line it tends to not auto scroll. 

Intelligenci_logo_on_transparent.thumb.png.a0b4eeba91c8fb82b7749ebf5bcb9246.png

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
On 11/25/2022 at 4:10 AM, ][NT3L][G3NC][ said:

If the output is longer than. One line it tends to not auto scroll. 

interesting, thanks

On 12/7/2022 at 6:09 PM, Tayuh said:

I suppose there should be a way to force the scroll down using some console script ?

I tested it but no...

Link to comment
Share on other sites

1 hour ago, Alwaysmore said:

interesting, thanks

I tested it but no...

Well it is actually possible if you run code from console.

 

const theLog = document.querySelector("div.logs");
const logShit = new MutationObserver(function(ms) {
  ms.forEach(function(m) {
    theLog.children[theLog.children.length - 1].scrollIntoViewIfNeeded();
  });
});

logShit.observe(theLog, {
  attributes: false,
  characterData: false,
  childList: true,
  subtree: false,
  attributeOldValue: false,
  characterDataOldValue: false
});

 

Intelligenci_logo_on_transparent.thumb.png.a0b4eeba91c8fb82b7749ebf5bcb9246.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...