-1

All I want to do is to use javascript to copy paste data from console's log

Using Chrome or Brave browsers, whenever I use console.log it always shows the portion highlighted in the image, how to get rid of it?

enter image description here

2
  • What's the exact benefit of getting rid of it? Not that you would be able to do so anyways, definitely not in Chrome.
    – Destroy666
    Commented Feb 4 at 1:23
  • I often use little javascript to extract text via console.log and then copy the data to excel to further do working on it, but these VM.... lines also get copied Commented Feb 5 at 4:51

1 Answer 1

0

There's no good solution for this, but there are workarounds. Some of which can be found e.g. here.

The linked answer by @tapeboy7 recommends adding your own function for logging. Which could be simplified to for example:

console.l = (...args) => queueMicrotask(console.log.bind(console, ...args))

Then you can use console.l('test') to output data/logs without that part.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .