CrashReportBody - Web APIs 编辑

Experimental

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The CrashReportBody interface of the Reporting API represents the body of a crash report (the return value of its Report.body property).

A crash report is generated when a document becomes unusable due to the browser (or one of its processes) crashing. For security reasons, no details of the crash are communicated in the body except for a general crash reason.

Properties

reason
A string representing the reason for the crash. Current possible reasons are:
  • oom: The browser ran out of memory.
  • unresponsive: The page was killed due to being unresponsive.

Examples

Crash reports are generally only retrievable via endpoints set up using the Report-To header. It is difficult to retrieve a crash report via a ReportingObserver, as by that point the page would have crashed!

Some sample JSON might look like this:

{
  "type": "crash",
  "age": 42,
  "url": "https://example.com/",
  "user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0",
  "body": {
    "reason": "oom"
  }
}

Note: Crash reports are always delivered to the endpoint group named default; there is currently no way to override this. If you want to receive other kinds of reports, but not crash reports, make sure to use a different name for the endpoint group that you choose for those reports. 

Specifications

SpecificationStatusComment
Reporting API
The definition of 'CrashReportBody' in that specification.
Editor's Draft 

See also

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:52 次

字数:3121

最后编辑:7年前

编辑次数:0 次

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