[issues] For affected cookies we link to corresponding requests

Cookie issues list affected cookies. When the user clicks on an
individual affected cookie, we now open the Network panel and filter
for all requests that set or want to set this cookie.

The old link simply navigated to the general Application > Cookies
pane, which didn't show anything.

R=sigurds@chromium.org

Change-Id: I8c4fcc0422f81d505ec82c9e8919537b3ac17c8b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119674
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
This commit is contained in:
Simon Zünd
2020-03-25 08:15:33 +00:00
committed by Commit Bot
parent 8c53b6f52b
commit c6a4eddf52
+14 -3
View File
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as UI from '../ui/ui.js';
import * as Network from '../network/network.js';
import * as SDK from '../sdk/sdk.js';
import * as UI from '../ui/ui.js';
class AffectedResourcesView {
/**
@@ -127,8 +128,18 @@ class AffectedCookiesView extends AffectedResourcesView {
appendAffectedCookie(cookie) {
const element = createElementWithClass('tr', 'affected-resource-cookie');
const name = createElementWithClass('td', '');
name.appendChild(Components.Linkifier.linkifyRevealable(
new SDK.Cookie.CookieReference(cookie.name, cookie.domain, cookie.path, cookie.siteForCookies), cookie.name));
name.appendChild(UI.UIUtils.createTextButton(cookie.name, () => {
Network.NetworkPanel.NetworkPanel.revealAndFilter([
{
filterType: 'cookie-domain',
filterValue: cookie.domain,
},
{
filterType: 'cookie-name',
filterValue: cookie.name,
}
]);
}, 'link-style devtools-link'));
const info = createElementWithClass('td', 'affected-resource-cookie-info');
// Prepend a space for all domains not starting with a "." to align them better.