Skip to content

Commit

Permalink
fix(trace-viewer): make 'hide route actions' work for .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Aug 1, 2024
1 parent bbe252a commit ad6c162
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/trace-viewer/src/ui/modelUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ const kRouteMethods = new Set([
'page.route', 'page.routefromhar', 'page.unroute', 'page.unrouteall',
'browsercontext.route', 'browsercontext.routefromhar', 'browsercontext.unroute', 'browsercontext.unrouteall',
]);
function normaliseApiName(apiName: string) {
// .NET handling
apiName = apiName.replace(/Async$/, '');
// Python handling
apiName = apiName.replaceAll('_', '');
return apiName.toLowerCase();
}
export function isRouteAction(action: ActionTraceEventInContext) {
return action.class === 'Route' || kRouteMethods.has(action.apiName.toLowerCase());
return action.class === 'Route' || kRouteMethods.has(normaliseApiName(action.apiName));
}

0 comments on commit ad6c162

Please sign in to comment.