I'm using Firefox 66.0.3.
When I execute the following snippet
[1,1,5,76,7,8,8,85,8,5,85,5,5,55].forEach(x => console.log(x))
or whatever code that has console.log()
the browser shows debugger eval code
at the end of the line in the output.
How to remove "debugger eval code" from output?
I'm using Firefox 66.0.3.
When I execute the following snippet
[1,1,5,76,7,8,8,85,8,5,85,5,5,55].forEach(x => console.log(x))
or whatever code that has console.log()
the browser shows debugger eval code
at the end of the line in the output.
How to remove "debugger eval code" from output?
Share Improve this question edited Sep 4, 2022 at 7:22 marc_s 757k184 gold badges1.4k silver badges1.5k bronze badges asked Apr 24, 2019 at 7:57 mihkovmihkov 1,19916 silver badges39 bronze badges 4- 3 I have to ask... why does it matter? – freefaller Commented Apr 24, 2019 at 7:58
-
I want to copy the whole output, without this
debugger eval code
– mihkov Commented Apr 24, 2019 at 8:26 - 1 That's just the way the console works, the right side shows where every log message es from. – Barmar Commented Apr 24, 2019 at 8:45
- Is there a setting to remove that ? – mihkov Commented Apr 24, 2019 at 10:32
3 Answers
Reset to default 3Unfortunately there is no way (at this date) to disable that but there is a way for solving your problem
Define an array with one "\n" element:
temp = ["\n"]
Add each of your message with "\n" at end to array
temp.push(message+"\n")
Then log the array with spread operator
console.log(...temp)
now you log your whole messages with just ONE eval code
you can now easily select all the log without eval code because of first "\n" element
Join your list with line breaks:
console.log([1,1,5,76,7,8,8,85,8,5,85,5,5,55].join('\n'))
You can then safely copy the result without the debugger eval code
strings.
I ran across this when trying to scrape some data I didn't want to try to copy and paste due to the other garbage that would have e with the data I wanted, so I will presume your case is similar.
If so, just use window.alert() instead of console.log() to prevent the extra characters.
The new code would bee:
window.alert([1,1,5,76,7,8,8,85,8,5,85,5,5,55])
or
collection = [1,1,5,76,7,8,8,85,8,5,85,5,5,55]; window.alert(collection);