This is my code:
foo();
var test;
function foo(){
function bar() {
test = console.trace();
}
bar();
}
console.log(test);
It logs out the following:
bar VM246:9
foo VM246:2
(anonymous function) VM232:777
InjectedScript._evaluateOn VM232:710
InjectedScript._evaluateAndWrap VM232:626
InjectedScript.evaluate VM246:12
undefined
So, according to the logs the trace while test is undefined
.
Is there a way to catch data from console.trace()
?
Lets say, I need the number 5
for the bar
and number 7
for the foo
.