如何从 chrome 调试 API 中捕获时间线数据
How to catch timeline data from chrome debugging API
任务:目标是获取所有由安装的扩展程序触发的功能。
预期输出: Javascript 函数调用,类似于时间轴面板中显示的内容。
描述: 如上所述我想从chrome获取时间线数据。为此,我正在使用 chrome remote debugging protocol to get timeline data using chrome javascript debugger API 的时间线功能。我正在使用以下代码启动调试器:
chrome.debugger.attach({ tabId: tabid }, version, onAttach.bind(null,tabid);
chrome.debugger.sendCommand({ tabId: tabid }, "Tracing.start");
然而,当我 运行 这段代码时,我收到一条错误消息,指出时间轴已被弃用,请使用跟踪。尽管官方文档没有提到时间轴已被弃用。我也尝试过跟踪以消除错误,但仍然没有捕获到任何事件。旗帜有问题吗?
阅读 Chrome Apps & Extensions Developer Tool 的代码后,我发现 chrome.activityLogPrivate API 通过不同的扩展名记录所有事件。但是,我无法通过在我的扩展中调用来 运行 它,它仍然未定义。我也找不到此扩展的文档。
稳定 1.1 Debugging protocol has no "Tracing", however, the "tip of the tree" docs 准确地说:
Timeline domain is deprecated. Please use Tracing instead.
这应该只是一个警告,因为:
As of Google Chrome 31, we commit to supporting v1.1. All subsequent 1.* versions of the protocol are going to be backwards compatible with 1.1. Our protocol backwards compatibility commitment is:
- No commands or events are removed from the protocol.
- No required parameters are added to the commands.
- No required parameters are removed from command responses or events.
所以你的命令应该正常工作。
chrome.activityLogPrivate
API 就是它在罐子上写的 - private。它只对 Chrome 代码中的特定白名单扩展启用,并且没有公开记录。
所以不,你不能使用它,除非你使用 hack like this one,不能保证有效。
任务:目标是获取所有由安装的扩展程序触发的功能。
预期输出: Javascript 函数调用,类似于时间轴面板中显示的内容。
描述: 如上所述我想从chrome获取时间线数据。为此,我正在使用 chrome remote debugging protocol to get timeline data using chrome javascript debugger API 的时间线功能。我正在使用以下代码启动调试器:
chrome.debugger.attach({ tabId: tabid }, version, onAttach.bind(null,tabid);
chrome.debugger.sendCommand({ tabId: tabid }, "Tracing.start");
然而,当我 运行 这段代码时,我收到一条错误消息,指出时间轴已被弃用,请使用跟踪。尽管官方文档没有提到时间轴已被弃用。我也尝试过跟踪以消除错误,但仍然没有捕获到任何事件。旗帜有问题吗?
阅读 Chrome Apps & Extensions Developer Tool 的代码后,我发现 chrome.activityLogPrivate API 通过不同的扩展名记录所有事件。但是,我无法通过在我的扩展中调用来 运行 它,它仍然未定义。我也找不到此扩展的文档。
稳定 1.1 Debugging protocol has no "Tracing", however, the "tip of the tree" docs 准确地说:
Timeline domain is deprecated. Please use Tracing instead.
这应该只是一个警告,因为:
As of Google Chrome 31, we commit to supporting v1.1. All subsequent 1.* versions of the protocol are going to be backwards compatible with 1.1. Our protocol backwards compatibility commitment is:
- No commands or events are removed from the protocol.
- No required parameters are added to the commands.
- No required parameters are removed from command responses or events.
所以你的命令应该正常工作。
chrome.activityLogPrivate
API 就是它在罐子上写的 - private。它只对 Chrome 代码中的特定白名单扩展启用,并且没有公开记录。
所以不,你不能使用它,除非你使用 hack like this one,不能保证有效。