[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);