mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(trace-viewer): make 'hide route actions' work for .NET (#31961)
This commit is contained in:
parent
73e0e92a7e
commit
69561a194a
@ -411,9 +411,28 @@ function collectSources(actions: trace.ActionTraceEvent[], errorDescriptors: Err
|
|||||||
}
|
}
|
||||||
|
|
||||||
const kRouteMethods = new Set([
|
const kRouteMethods = new Set([
|
||||||
'page.route', 'page.routefromhar', 'page.unroute', 'page.unrouteall',
|
'page.route',
|
||||||
'browsercontext.route', 'browsercontext.routefromhar', 'browsercontext.unroute', 'browsercontext.unrouteall',
|
'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) {
|
export function isRouteAction(action: ActionTraceEventInContext) {
|
||||||
return action.class === 'Route' || kRouteMethods.has(action.apiName.toLowerCase());
|
return action.class === 'Route' || kRouteMethods.has(action.apiName.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user