New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 731810 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Implement Deprecation Reports, ReportingObserver

Project Member Reported by paulmeyer@chromium.org, Jun 9 2017

Issue description

Change description:
These features are closely related to the previously proposed Reporting API (https://bugs.chromium.org/p/chromium/issues/detail?id=676016). Deprecation reports are one type of report be routed into the Reporting API backend. ReportingObserver is a new observer that will allow developers to observe reports from JavaScript.

See this explainer (https://github.com/WICG/reporting/blob/master/EXPLAINER.md#basic-report-formats) for more details.

Changes to API surface:
* Adds ReportingObserver
* Adds ability for Deprecation reports to be sent into the new Reporting API backend.

Links:
Public standards discussion: https://github.com/WICG/reporting/issues/27
https://github.com/WICG/reporting/issues/29

Support in other browsers:
Internet Explorer: Not implemented.
Firefox: Not implemented.
Safari: Not implemented.


 

Comment 1 by rbyers@chromium.org, Jul 18 2017

Status: Started (was: Assigned)
WIP CL: https://chromium-review.googlesource.com/c/564016/
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67d19ec113dae3c7ff99374085eb3240b0d4cfd9

commit 67d19ec113dae3c7ff99374085eb3240b0d4cfd9
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Wed Jul 26 17:57:25 2017

Create ReportingObserver and DeprecationReports.

This patch both implements ReportingObserver, and generates DeprecationReports to route to ReportingObservers.

See this explainer for more details on these features (working spec): https://github.com/WICG/reporting/blob/master/EXPLAINER.md

Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/B1oztuLlzxg

Bug:  731810 
Change-Id: If6ebab0aa106788b97f8ef5b0b64540171387923
Reviewed-on: https://chromium-review.googlesource.com/564016
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489690}
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/LayoutTests/reporting-observer/deprecation.html
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/LayoutTests/reporting-observer/resources/deprecation.js
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/BUILD.gn
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/Deprecation.h
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/DeprecationReport.h
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/DeprecationReport.idl
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/Report.h
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/Report.idl
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportBody.h
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportBody.idl
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportingContext.cpp
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportingContext.h
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportingObserver.cpp
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportingObserver.h
[add] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/core/frame/ReportingObserver.idl
[modify] https://crrev.com/67d19ec113dae3c7ff99374085eb3240b0d4cfd9/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5

Cc: juliatut...@chromium.org

Comment 4 by cha...@chromium.org, Aug 15 2017

Components: Blink>ReportingObserver

Comment 5 by owe...@chromium.org, Sep 12 2017

Labels: migrated-launch-owp Type-Task
This issue has been automatically relabelled type=task because type=launch-owp issues are now officially deprecated. The deprecation is because they were creating confusion about how to get launch approvals, which should be instead done via type=launch issues.

We recommend this issue be used for implementation tracking (for public visibility), but if you already have an issue for that, you may mark this as duplicate.

For more details see here: https://docs.google.com/document/d/1JA6RohjtZQc26bTrGoIE_bSXGXUDQz8vc6G0n_sZJ2o/edit

For any questions, please contact owencm, sshruthi, larforge

Comment 6 by owe...@chromium.org, Sep 13 2017

Summary: Implement Deprecation Reports, ReportingObserver (was: OWP Launch: Deprecation Reports, ReportingObserver)
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8eac569dd8d418fdd8071be8b747e03df09308ed

commit 8eac569dd8d418fdd8071be8b747e03df09308ed
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Thu Sep 21 05:31:34 2017

Generate intervention reports and route them to ReportingObserver.

This patch implements a centralized location for the generation of
intervention reports, which both sends a message to the console,
and routes the reports to any registered ReportingObservers.

This patch also connects the existing interventions in TouchEvent to
utilize this new flow. Other interventions will need to be connected in
future patches.

Bug:  564071 ,  731810 
Change-Id: I0aa435ca6ebfe5950fbcd8795b678852a55f5d28
Reviewed-on: https://chromium-review.googlesource.com/652958
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503363}
[modify] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/LayoutTests/reporting-observer/deprecation.html
[add] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/LayoutTests/reporting-observer/intervention.html
[add] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/LayoutTests/reporting-observer/resources/intervention.js
[modify] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/events/TouchEvent.cpp
[modify] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/events/TouchEventTest.cpp
[modify] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/frame/BUILD.gn
[add] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/frame/Intervention.cpp
[add] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/frame/Intervention.h
[add] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/frame/InterventionReport.h
[add] https://crrev.com/8eac569dd8d418fdd8071be8b747e03df09308ed/third_party/WebKit/Source/core/frame/InterventionReport.idl

Project Member

Comment 8 by bugdroid1@chromium.org, Sep 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f40912dcc43c0ff9447e914c606c8052f281668

commit 8f40912dcc43c0ff9447e914c606c8052f281668
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Tue Sep 26 23:57:18 2017

Hook deprecation reports up to Reporting API

This patch connects deprecation reports (which are already routed into
ReportingObserver) to the ReporingServiceProxy mojo interface.

Bug:  731810 ,  564071 
Change-Id: I3885ae8c723b407628eb6d931b097521e9b89526
Reviewed-on: https://chromium-review.googlesource.com/646638
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504528}
[add] https://crrev.com/8f40912dcc43c0ff9447e914c606c8052f281668/third_party/WebKit/LayoutTests/reporting-observer/reporting-api.html
[modify] https://crrev.com/8f40912dcc43c0ff9447e914c606c8052f281668/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/8f40912dcc43c0ff9447e914c606c8052f281668/third_party/WebKit/Source/core/frame/DeprecationReport.h

Project Member

Comment 9 by bugdroid1@chromium.org, Sep 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f808263890954e2c8c4fc86ed4e48f54ac8ce26

commit 6f808263890954e2c8c4fc86ed4e48f54ac8ce26
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Thu Sep 28 01:05:07 2017

Hook intervention reports up to Reporting API

This patch connects intervention reports to the ReporingServiceProxy mojo
interface.

Notes on testing: 
1) The test for this patch's new functionality is added to reporting-api.html,
where the mock reporting class there can be reused.
2) This patch also factors out the intervention-generating code to a
function in intervention.js, so it can be used in both reporting-api.html
and intervention.html tests.

Bug:  731810 ,  564071 
Change-Id: I9ea961f6672ece81712c657ee7d9350b0520bb29
Reviewed-on: https://chromium-review.googlesource.com/685992
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504850}
[modify] https://crrev.com/6f808263890954e2c8c4fc86ed4e48f54ac8ce26/third_party/WebKit/LayoutTests/reporting-observer/intervention.html
[modify] https://crrev.com/6f808263890954e2c8c4fc86ed4e48f54ac8ce26/third_party/WebKit/LayoutTests/reporting-observer/reporting-api.html
[modify] https://crrev.com/6f808263890954e2c8c4fc86ed4e48f54ac8ce26/third_party/WebKit/LayoutTests/reporting-observer/resources/intervention.js
[modify] https://crrev.com/6f808263890954e2c8c4fc86ed4e48f54ac8ce26/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/6f808263890954e2c8c4fc86ed4e48f54ac8ce26/third_party/WebKit/Source/core/frame/Intervention.cpp
[modify] https://crrev.com/6f808263890954e2c8c4fc86ed4e48f54ac8ce26/third_party/WebKit/Source/core/frame/InterventionReport.h

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2

commit a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Thu Nov 23 23:15:55 2017

Add |id| and |anticipatedRemoval| fields to deprecation reports.

This patch changes the way that deprecation messages are stored in
Deprecation.cpp, such that each deprecated feature is also given a
unique id and anticipated removal milestone. This info is then used to
populate two new fields in deprecation reports: |id| and
|anticipatedRemoval|. These new fields are only available to
ReportingObserver so far, and will be routed to Reporting API in a
subsequent patch.

Bug:  731810 ,  564071 
Change-Id: I3250bf940216238c531c3ec358539863598e3003
Reviewed-on: https://chromium-review.googlesource.com/772999
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519028}
[modify] https://crrev.com/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2/third_party/WebKit/LayoutTests/reporting-observer/resources/deprecation.js
[modify] https://crrev.com/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2/third_party/WebKit/Source/core/frame/Deprecation.h
[modify] https://crrev.com/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2/third_party/WebKit/Source/core/frame/DeprecationReport.h
[modify] https://crrev.com/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2/third_party/WebKit/Source/core/frame/DeprecationReport.idl
[modify] https://crrev.com/a7d2b2682a8027f258b4b5d50ebeb1ce77724bb2/third_party/WebKit/Source/core/frame/Intervention.h

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/152136f19bb0595ae79a64b9a44c5cfa88577102

commit 152136f19bb0595ae79a64b9a44c5cfa88577102
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Thu Nov 30 16:36:17 2017

Add |columnNumber| field to deprecation and intervention reports.

This patch updates both deprecation and intervention reports to include
a new field, |columnNumber|, as shown in the updated explainer:
https://github.com/WICG/reporting/blob/master/EXPLAINER.md

Bug:  731810 
Change-Id: I78667792c19f2b5da8bf7c3e73c562457d63ef73
Reviewed-on: https://chromium-review.googlesource.com/797731
Reviewed-by: Julia Tuttle <juliatuttle@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520569}
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/content/browser/net/reporting_service_proxy.cc
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/LayoutTests/reporting-observer/intervention.html
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/LayoutTests/reporting-observer/reporting-api.html
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/LayoutTests/reporting-observer/resources/deprecation.js
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/Source/core/frame/DeprecationReport.idl
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/Source/core/frame/Intervention.cpp
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/Source/core/frame/InterventionReport.idl
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/Source/core/frame/MessageReport.h
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/Source/platform/weborigin/ReportingServiceProxyPtrHolder.h
[modify] https://crrev.com/152136f19bb0595ae79a64b9a44c5cfa88577102/third_party/WebKit/public/platform/reporting.mojom

Project Member

Comment 12 by bugdroid1@chromium.org, Dec 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e5df6cff299b600b5dd98be5b3d035364c40a33f

commit e5df6cff299b600b5dd98be5b3d035364c40a33f
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Tue Dec 05 00:28:26 2017

Route |id| and |anticipatedRemoval| fields in deprecation reports to
Reporting API.

A previous patch
(https://chromium-review.googlesource.com/c/chromium/src/+/772999) added
these new fields. This patch routes them to the Reporting API, and
updates the associated test.

Bug:  731810 
Change-Id: I3a9a3ac71d894f784f18d5fb51898184541e6216
Reviewed-on: https://chromium-review.googlesource.com/775154
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Julia Tuttle <juliatuttle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521546}
[modify] https://crrev.com/e5df6cff299b600b5dd98be5b3d035364c40a33f/content/browser/net/reporting_service_proxy.cc
[modify] https://crrev.com/e5df6cff299b600b5dd98be5b3d035364c40a33f/third_party/WebKit/LayoutTests/reporting-observer/reporting-api.html
[modify] https://crrev.com/e5df6cff299b600b5dd98be5b3d035364c40a33f/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/e5df6cff299b600b5dd98be5b3d035364c40a33f/third_party/WebKit/Source/platform/weborigin/ReportingServiceProxyPtrHolder.h
[modify] https://crrev.com/e5df6cff299b600b5dd98be5b3d035364c40a33f/third_party/WebKit/public/platform/reporting.mojom

Project Member

Comment 13 by bugdroid1@chromium.org, Jun 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed85628b2a54942d9e7f050087df4ac45b8da3b7

commit ed85628b2a54942d9e7f050087df4ac45b8da3b7
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Thu Jun 14 00:33:07 2018

Make the Deprecation/Intervention report IDLs match the spec.

See spec here: https://wicg.github.io/reporting/#report-types

Specifically, some fields in the IDLs were originally not
marked nullable, but now are.

Bug:  564071 ,  731810 
Change-Id: I731ee46f39920c864856f7eda7f18045f779d1c3

TBR: rbyers@chromium.org
Change-Id: I731ee46f39920c864856f7eda7f18045f779d1c3
Reviewed-on: https://chromium-review.googlesource.com/1097602
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567064}
[modify] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/content/browser/net/reporting_service_proxy.cc
[modify] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/public/platform/reporting.mojom
[modify] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/core_idl_files.gni
[modify] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/deprecation.cc
[rename] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/deprecation_report_body.h
[rename] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/deprecation_report_body.idl
[modify] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/intervention.cc
[delete] https://crrev.com/d136a18aaa3373983323fa4aff7f7c1e359d4e8b/third_party/blink/renderer/core/frame/intervention_report.h
[add] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/intervention_report_body.h
[rename] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/intervention_report_body.idl
[delete] https://crrev.com/d136a18aaa3373983323fa4aff7f7c1e359d4e8b/third_party/blink/renderer/core/frame/message_report.h
[add] https://crrev.com/ed85628b2a54942d9e7f050087df4ac45b8da3b7/third_party/blink/renderer/core/frame/message_report_body.h

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67bbed9c8a7897241009f9ad0fdd216a3472498d

commit 67bbed9c8a7897241009f9ad0fdd216a3472498d
Author: Paul Meyer <paulmeyer@chromium.org>
Date: Tue Jun 19 01:11:47 2018

Implement ReportingObserverOptions and the |buffered| option.

As per this spec:
https://wicg.github.io/reporting/#dictdef-reportingobserveroptions

Bug:  731810 
Change-Id: I50840a97c2858fd04f397fd9799156d8e1e873c5
Reviewed-on: https://chromium-review.googlesource.com/1101312
Commit-Queue: Paul Meyer <paulmeyer@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568274}
[add] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/WebKit/LayoutTests/reporting-observer/buffering.html
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/core_idl_files.gni
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/deprecation.cc
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/deprecation_report_body.idl
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/intervention.cc
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/intervention_report_body.idl
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/reporting_context.cc
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/reporting_context.h
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/reporting_observer.cc
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/reporting_observer.h
[modify] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/reporting_observer.idl
[add] https://crrev.com/67bbed9c8a7897241009f9ad0fdd216a3472498d/third_party/blink/renderer/core/frame/reporting_observer_options.idl

Status: Fixed (was: Started)

Comment 19 by block.rx...@gmail.com, Today (21 hours ago)

Hi

Hi all

I'm trying ReportingObserver like below.
report has value, but not JSON serialisable.
means `JSON.stringify(report)` only results in `{}`.

https://w3c.github.io/reporting/#concept-reports

so currently I need workaround like below.

```
if (window.ReportingObserver) {
  console.log('ReportingObserver');
  const observer = new ReportingObserver((reports, observer) => {
    for (const report of reports) {
      console.log(report.type, report.url, report.body)

      const r = {
        type: report.type,
        url:  report.url,
        body: {},
      }

      switch(report.type) {
        case "deprecation":
          r.body = {
            id:                 report.body.id,
            anticipatedRemoval: report.body.anticipatedRemoval,
            message:            report.body.message,
            sourceFile:         report.body.sourceFile,
            lineNumber:         report.body.lineNumber,
            columnNumber:       report.body.columnNumber,
          }
          break;
        case "intervention":
          r.body = {
            id:           report.body.id,
            message:      report.body.message,
            sourceFile:   report.body.sourceFile,
            lineNumber:   report.body.lineNumber,
            columnNumber: report.body.columnNumber,
          }
          break;
        case "crash":
          r.body = {
            id:     report.body.id,
            reason: report.body.reason,
          }
          break;
      }

      const URL = "https://report-uri.jxck.io/report-to.cgi"
      navigator.sendBeacon(URL, JSON.stringify(r))
    }
  }, {buffered: true})

  observer.observe()
}
```

this works, but I'm happy to use JSON.stringify()

thanks
Jxck

Sign in to add a comment