Skip to content

Commit 2cfe733

Browse files
committed
cherry-pick(#31961): fix(trace-viewer): make 'hide route actions' work for .NET
1 parent 5fdf976 commit 2cfe733

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packages/trace-viewer/src/ui/modelUtil.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,28 @@ function collectSources(actions: trace.ActionTraceEvent[], errorDescriptors: Err
411411
}
412412

413413
const kRouteMethods = new Set([
414-
'page.route', 'page.routefromhar', 'page.unroute', 'page.unrouteall',
415-
'browsercontext.route', 'browsercontext.routefromhar', 'browsercontext.unroute', 'browsercontext.unrouteall',
414+
'page.route',
415+
'page.routefromhar',
416+
'page.unroute',
417+
'page.unrouteall',
418+
'browsercontext.route',
419+
'browsercontext.routefromhar',
420+
'browsercontext.unroute',
421+
'browsercontext.unrouteall',
416422
]);
423+
{
424+
// .NET adds async suffix.
425+
for (const method of [...kRouteMethods])
426+
kRouteMethods.add(method + 'async');
427+
// Python methods which contain underscores.
428+
for (const method of [
429+
'page.route_from_har',
430+
'page.unroute_all',
431+
'context.route_from_har',
432+
'context.unroute_all',
433+
])
434+
kRouteMethods.add(method);
435+
}
417436
export function isRouteAction(action: ActionTraceEventInContext) {
418437
return action.class === 'Route' || kRouteMethods.has(action.apiName.toLowerCase());
419438
}

0 commit comments

Comments
 (0)