[issues] Generate COEP releated issues in the front-end
As back-end changes are being blocked, we opted to implement issue
generation for COEP in the front-end only for now, and will move it
to the back-end at a later point in time.
This CL adds an issue generator in the front-end that scans network
activity and identifies COEP issues, filing issues for each of them.
Screenshot: https://imgur.com/a/4spYE4d
Change-Id: I1d9baed1bc996efb94bcf0bab5cddde8dbbbe904
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2118096
Commit-Queue: Sigurd Schneider <[email protected]>
Reviewed-by: Mathias Bynens <[email protected]>
Reviewed-by: Simon Zünd <[email protected]>
diff --git a/front_end/network/RequestHeadersView.js b/front_end/network/RequestHeadersView.js
index 5ccadf7..513ab15 100644
--- a/front_end/network/RequestHeadersView.js
+++ b/front_end/network/RequestHeadersView.js
@@ -154,7 +154,20 @@
exampleNode.createChild('span', 'comment').textContent = example.comment;
}
}
- if (header.details.link) {
+
+ if (Root.Runtime.experiments.isEnabled('issuesPane') &&
+ SDK.RelatedIssue.hasIssueOfCategory(
+ this._request, SDK.RelatedIssue.IssueCategory.CrossOriginEmbedderPolicy)) {
+ const link = createElementWithClass('div', 'devtools-link');
+ link.onclick = () => {
+ SDK.RelatedIssue.reveal(this._request, SDK.RelatedIssue.IssueCategory.CrossOriginEmbedderPolicy);
+ };
+ const text = createElementWithClass('span', 'devtools-link');
+ text.textContent = 'Learn more in the issues panel';
+ link.appendChild(text);
+ link.prepend(UI.Icon.Icon.create('largeicon-breaking-change', 'icon'));
+ callToActionBody.appendChild(link);
+ } else if (header.details.link) {
const link = UI.XLink.XLink.create(header.details.link.url, ls`Learn more`, 'link');
link.prepend(UI.Icon.Icon.create('largeicon-link', 'link-icon'));
callToActionBody.appendChild(link);
diff --git a/front_end/network/network_strings.grdp b/front_end/network/network_strings.grdp
index 2444ce3..d6f8fa3 100644
--- a/front_end/network/network_strings.grdp
+++ b/front_end/network/network_strings.grdp
@@ -255,9 +255,6 @@
<message name="IDS_DEVTOOLS_47d546fc3634f59db7e350acbb01885c" desc="Text in Network Log View of the Network panel">
<ph name="SELECTEDTRANSFERSIZE">$1s<ex>10</ex></ph> B / <ph name="TRANSFERSIZE">$2s<ex>15</ex></ph> B transferred over network
</message>
- <message name="IDS_DEVTOOLS_4909c5e867e2322253bef625307a85a8" desc="Text in Headers View of the Network panel">
- Only choose this option if an arbitrary website including this resource does not impose a security risk.
- </message>
<message name="IDS_DEVTOOLS_490aa6e856ccf208a054389e47ce0d06" desc="Text in Event Source Messages View of the Network panel">
Id
</message>
@@ -426,9 +423,6 @@
<message name="IDS_DEVTOOLS_c21b43091d5f2cb131e79122289ce033" desc="Text in Network Log View of the Network panel">
<ph name="SELECTEDRESOURCESIZE">$1s<ex>40</ex></ph> B / <ph name="RESOURCESIZE">$2s<ex>50</ex></ph> B resources loaded by the page
</message>
- <message name="IDS_DEVTOOLS_c823a983a972cfb5ee4b8bf1918080d3" desc="Text in Headers View of the Network panel">
- Choose this option if the resource and the document are served from the same site.
- </message>
<message name="IDS_DEVTOOLS_ca092ce554360617d7bb503ff16dcb7c" desc="Text for toggling the view of header data (e.g. query string parameters) from parsed to source in the headers tab">
View source
</message>