如何从chrome控制台复制堆栈跟踪?

时间:2016-04-08 15:14:08

标签: google-chrome-devtools

假设我在控制台中获得了这样的堆栈跟踪:

enter image description here

如何复制保留格式的堆栈跟踪?

当我复制这个堆栈跟踪时,我得到一条长行:

VM1130:2 Foobar not foundplayer.store.registerListener @ VM1130:2logErrorsInCallback @ magic_store:221registerListener @ magic_store:240registerListenerThis @ magic_store:246(anonymous function) @ VM1130:2InjectedScript._evaluateOn @ (program):878InjectedScript._evaluateAndWrap @ (program):811InjectedScript.evaluate @ (program):667

有没有办法以更结构化的方式复制堆栈跟踪?

1 个答案:

答案 0 :(得分:0)

复制粘贴似乎现在格式正常。刚从错误中复制了这个:

Uncaught ReferenceError: osdlfm is not defined
    at <anonymous>:1:1
    at ad.js:12
    at new Promise (<anonymous>)
    at HTMLDocument.n (ad.js:12)

扩展错误后显示的堆栈跟踪格式也正常:

(anonymous) @ VM183:1
(anonymous) @ ad.js:12
n @ ad.js:12

console stack trace

版本信息:

  • 谷歌浏览器:63.0.3239.132(官方构建)(64位)
  • 修订版:2e6edcfee630baa3775f37cb11796b1603a64360-refs / branch-heads / 3239 @ {#709}
  • 操作系统:Mac OS X