Skip to content

Commit 7efe98c

Browse files
committed
Add more params to the thirdparty event
We can now filter through those third party events based on third party name and timestamp. Those filters can be combined
1 parent de49fef commit 7efe98c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
458458
// Custom event to show third-party scripts as overlay. Extracted from ThirdParties.ts
459459
// @ts-ignore
460460
document.getElementById('-blink-dev-tools')?.addEventListener('showthirdparty', (event: CustomEvent) => {
461-
const {navigationId} = event.detail;
461+
const {navigationId, filterByThirdParty, filterByTimestamp} = event.detail;
462462
this.#setActiveInsight({
463463
name: 'third-parties',
464464
navigationId,
@@ -472,11 +472,15 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
472472

473473
const overlays: Overlays.Overlays.TimelineOverlay[] = [];
474474
for (const [entity, requests] of insight.requestsByEntity) {
475-
if (entity === insight.firstPartyEntity) {
475+
if (entity === insight.firstPartyEntity || (filterByThirdParty && entity.name !== filterByThirdParty)) {
476476
continue;
477477
}
478478

479479
for (const request of requests) {
480+
if (filterByTimestamp && request.ts > filterByTimestamp) {
481+
continue;
482+
}
483+
480484
// The overlay entry can be used to highlight any trace entry, including network track entries.
481485
// This function is extracted from the ThirdParties overlay component, since it is not accessible
482486
// from outside the component.

0 commit comments

Comments
 (0)