webkit/chrome 的 WebInspector 资源检查是如何工作的?

发布于 2024-09-12 00:02:53 字数 274 浏览 1 评论 0原文

我一直想知道资源检查如何工作webkit/safari/chrome 的 WebInspector 工作。

浏览器必须提供本机 BPI 或 JavaScript 的某些内容来显示查询列表及其时间线,二进制 API 称为什么?我可以使用相同的 API 来编写 Chromium 扩展吗?

I always want to know how the resource inspection work in webkit/safari/chrome's WebInspector work.

The browser must provide a native BPI or something for javascript to display list of queries and their timelines, what is the binary API called? Can I use the same API to write a Chromium extension?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

徒留西风 2024-09-19 00:02:53

资源请求和其他 DevTools/WebInspector 相关数据由 InspectorController 及其代理收集。 (它只是 C++ 代码)

之后,所有数据都作为 WebInspector 对象方法的 JS 调用推送到 WebInspector 中。

您可能知道所有 DevTools/WebInspector 的 GUI 都是一个 html 页面和大量 JavaScript。

你可以尝试通过Inspector本身来探究Inspector的内部世界。

  1. 使用标志启动 Chrome
    --每个选项卡进程;
  2. 在非停靠模式下打开检查器窗口;
  3. 在检查器窗口中按 Ctrl-Shift-I。

检查器和被检查页面之间的所有流量都通过两个函数传递:
从检查器到检查页面 - sendMessageToBackend
从检查页面到检查器 - devtools$$dispatch

您可以通过此 链接

The resource requests and other DevTools/WebInspector related data is collecting by InspectorController and it's agents. (it just C++ code)

After that all the data is pushing into WebInspector as JS calls of WebInspector object's methods.

As you probably know all the DevTools/WebInspector's GUI is an html page and a lot of JavaScript.

You can try to investigate the internal world of Inspector by Inspector itself.

  1. start Chrome with flag
    --process-per-tab;
  2. open Inspector window in undocked mode;
  3. press Ctrl-Shift-I in Inspector window.

All the traffic between Inspector and inspected page are passing via two functions:
from Inspector to inspected page - sendMessageToBackend
from inspected page to Inspector - devtools$$dispatch

You can track the latest changes for WebInspector in WebKit via this link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文