mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user