google-chrome - 从 Chrome 开发工具中的网络选项卡预览复制变量

标签 google-chrome google-chrome-devtools

我正在使用 Chrome 开发工具,并通过网络 Pane 进行挖掘,以通过预览选项卡查看 XHR 响应。我想从预览中抓取一个特定的对象。但是当我尝试 store as global variable通过右键单击预览对象,创建的临时变量为空。

我觉得这很奇怪,因为数据在内存中(否则根本不会显示)。这是一个相当大的响应数组的示例,我试图从中获取特定对象。

Dev Tools

为了澄清,我可以存储一个出现在控制台中的变量。但我无法从网络选项卡的预览 Pane 中存储变量。 Chrome 开发工具中是否有我忽略的功能,或者我是否被迫控制台记录我的 XHR 响应并从那里提取对象?

我真的不想在我的代码中添加任何 console.log() 或其他断点,只是为了稍后删除它们。挖掘超长的原始 JSON 响应也是不切实际的。我在 Windows 7 上使用 Chrome 47。

最佳答案

我可以通过以下方式让它工作:

  1. 右键单击数组索引
  2. “存储为全局变量”

然后从控制台输入:

copy(temp1);

然后它将出现在剪贴板上。

enter image description here

关于google-chrome - 从 Chrome 开发工具中的网络选项卡预览复制变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34530967/

相关文章:

google-chrome - 如何将现有项目(Chrome 扩展程序)从我的个人帐户移动到 Group Publisher 帐户?

jquery - Bootstrap 数据表表工具按钮显示奇怪的图像

python - WebDriver异常: Message: unknown error: Chrome failed to start: exited abnormally with ChromeDriver Chrome and Selenium on debian server

google-chrome - Chrome 性能分析器在处理时崩溃

google-chrome - 在 Chrome DevTools 中搜索 HTML 元素

css - 在 chrome 浏览器中缩放( Ctrl + )时更改绝对 Div 顶部位置

google-chrome - xsl :import and xsl:include in stylesheets don't work on Google Chrome

css - 为什么 background-image 属性会在 Chrome 中引起警告?

javascript - 即使整个脚本从 html 页面中删除后,setInterval 仍会继续运行

google-chrome-devtools - 如何关闭 Chrome 开发工具中的问题横幅?