Skip to content

Commit

Permalink
cherry-pick(#31961): fix(trace-viewer): make 'hide route actions' wor…
Browse files Browse the repository at this point in the history
…k for .NET
  • Loading branch information
mxschmitt committed Aug 1, 2024
1 parent 5fdf976 commit 2cfe733
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions packages/trace-viewer/src/ui/modelUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,28 @@ function collectSources(actions: trace.ActionTraceEvent[], errorDescriptors: Err
}

const kRouteMethods = new Set([
'page.route', 'page.routefromhar', 'page.unroute', 'page.unrouteall',
'browsercontext.route', 'browsercontext.routefromhar', 'browsercontext.unroute', 'browsercontext.unrouteall',
'page.route',
'page.routefromhar',
'page.unroute',
'page.unrouteall',
'browsercontext.route',
'browsercontext.routefromhar',
'browsercontext.unroute',
'browsercontext.unrouteall',
]);
{
// .NET adds async suffix.
for (const method of [...kRouteMethods])
kRouteMethods.add(method + 'async');
// Python methods which contain underscores.
for (const method of [
'page.route_from_har',
'page.unroute_all',
'context.route_from_har',
'context.unroute_all',
])
kRouteMethods.add(method);
}
export function isRouteAction(action: ActionTraceEventInContext) {
return action.class === 'Route' || kRouteMethods.has(action.apiName.toLowerCase());
}

0 comments on commit 2cfe733

Please sign in to comment.