From c6a4eddf528c6f45cd3e4cd5ed0d64f23d18d8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Z=C3=BCnd?= Date: Wed, 25 Mar 2020 08:22:37 +0100 Subject: [PATCH] [issues] For affected cookies we link to corresponding requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: Simon Zünd --- front_end/issues/IssuesPane.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/front_end/issues/IssuesPane.js b/front_end/issues/IssuesPane.js index e94e8f5a53..7707412b5d 100644 --- a/front_end/issues/IssuesPane.js +++ b/front_end/issues/IssuesPane.js @@ -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.