- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
下面是我访问https://www.ted.com的截图并检查 Google Chrome DevTools 的“网络”选项卡,并查看根请求和子请求的时间数据。
如何使用 Puppeteer 以编程方式获取上述所有计时数据?理想情况下,它看起来像这样的 JSON 结构:
{
name: "www.ted.com",
queueTime: 0,
startedTime: 1.93,
stalledTime: 4.59,
dnsLookupTime: 10.67,
initialConnectionTime: <the number of milliseconds>,
...
},
{
name: <the next child request>,
...
}
最佳答案
您想检查 HAR(HTTP 存档)文件,这是您将通过 saving the data 创建的文件通过 Chrome。
引述什么是 HAR 文件 ( source ):
The HAR file format is an evolving standard and the information contained within it is both flexible and extensible. You can expect a HAR file to include a breakdown of timings including:
- How long it takes to fetch DNS information
- How long each object takes to be requested
- How long it takes to connect to the server
- How long it takes to transfer assets from the server to the browser of each object
The data is stored as a JSON document and extracting meaning from the low-level data is not always easy. But with practice a HAR file can quickly help you identify the key performance problems with a web page, letting you efficiently target your development efforts at areas of your site that will deliver the greatest results.
有像puppeteer-har这样的库和 chrome-har可以使用 puppeteer 创建 HAR 文件。
代码示例(对于 puppeteer-har,引用自页面)
const har = new PuppeteerHar(page);
await har.start({ path: 'results.har' });
await page.goto('http://example.com');
await har.stop();
关于google-chrome-devtools - 使用 Puppeteer,如何获取 Chrome DevTools 的 "Network"选项卡的时间信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57526202/
语境 对于我的许多 js 文件,我没有源映射。当使用 devtools 控制台时,它会污染有关的警告。我不想关闭所有警告,但那些对我来说并不是真的有用 问题 如何抑制 Chrome DevTools
我有这个 Chrome DevTools 颜色选择器问题,当我将停靠位置更改为 时,吸管不起作用。底部 .默认设置在右侧,颜色选择器吸管工作正常,但当我改变位置时就不行了。有什么设置吗?因为我无法从
如图所示,我想知道是否有键盘快捷键可以逐个或批量关闭这些选项卡 最佳答案 AltW 或 OptW (Mac) 关闭事件选项卡。见 Sources panel keyboard shortcuts .
我正在测试我的 HTML 的可访问性。在使用 TAB 键导航 HTML 时,焦点环有时会消失,因为具有焦点的元素被隐藏了。那时我不知道哪个 DOM 元素有焦点。 有没有一种方法可以在 Chrome D
我正在使用 ios-webkit-debug-proxy 和 remotedebug-ios-webkit 适配器从 Linux 上的 Chrome Devtools 调试运行 Safari 的 IO
尝试运行 Nativescript 调试 session ,每次我输入 chrome-devtools://devtools/bundled/inspector.html?experiments=tr
看起来渲染设置不像以前那样(即启用绘画闪烁、显示图层边框、显示 FPS 表、显示滚动性能问题)。 我怎样才能再次访问这些功能? 最佳答案 渲染设置已从 移动 Chrome 48 .您现在可以通过三点菜
我正在使用 devtools 调试一个大的 DOM: 我想为这个 div 添加“书签”,这样我就可以轻松地再次跳转到它。 如果此书签能够在页面重新加载后继续存在,那就太好了。 有办法吗? 最佳答案 我
我想弄清楚为什么我的应用程序性能很差。所以我在 DevTools 中做了一个性能记录,我可以看到帧通常需要大约 150 毫秒,这太长了。 但是我不明白为什么框架需要这么多时间。有一些 javascri
我正在使用 devtools 调试一个大的 DOM: 我想为这个 div 添加“书签”,这样我就可以轻松地再次跳转到它。 如果此书签能够在页面重新加载后继续存在,那就太好了。 有办法吗? 最佳答案 我
我希望在页面刷新时打开 DevTools 是很常见的。我可以使用 DevTools 从一开始就调试该页面吗? 最佳答案 您可以远程调试自己的 Chrome 实例,以获得每个页面的完整 DevTools
我经常使用控制台来输入和评估表达式。很多时候我是错误的并且捏造了一些表达式名称。这样做之后,chrome devtools 控制台将自动完成并提示我的一些错误输入。 有没有办法清除控制台历史建议? 最
如果我打开 google DevTools 我找不到时间轴面板 如此处所述: 根本没有标签。怎么了? 我在 Windows 7 和 Chrome 61.0.3163.91 最佳答案 时间轴面板现在称为
Google Chrome Devtools 中的事件监听器断点提供了多种选择,但对我来说,它们并不是很有用,因为它们总是让我陷入代码的一些不相关部分。 我想知道是否可以将其限制为仅一类?例如 onM
Chrome 开发工具过去常常为我按字母顺序在“范围” Pane 中显示属性。例如,请参阅此处有关“Google Chrome 中源选项卡中的范围”的屏幕截图:https://dev.to/shado
我尝试使用 Chrome DevTools 为 Android 应用程序执行 SQL 查询,但这是不可能的,因为输入按钮将光标移动到下一行而不是执行命令。前一段时间它起作用了。 我重新安装了 Chro
我有相对简单的 webpack 配置文件(如下): module.exports = { entry: "./src/main.js", output: { filen
我有这个简单的代码 input:hover{border: 3px solid blue;} 预期行为:当我将鼠标悬停在输入上时,新样式应该出现在 devtools 样式部分,但它仅在我通过 dev
documentation说“每次打开 DevTools 窗口时都会创建扩展的 DevTools 页面实例。DevTools 页面在 DevTools 窗口的生命周期内存在。” 然而,Facebook
我有一个页面,其中我使用 morris.js 插件显示 23 个 donut chart 。在性能分析期间,我遇到了这个: 当然还有 22 个以上的警告。结果时间为 401 毫秒。 我对每个 donu
我是一名优秀的程序员,十分优秀!