MCPcopy
hub / github.com/browserless/browserless / handler

Method handler

src/shared/performance.http.ts:49–71  ·  view source on GitHub ↗
(
    req: Request,
    res: ServerResponse,
    _logger: Logger,
    browser: BrowserInstance,
  )

Source from the content-addressed store, hash-verified

47 path = [HTTPRoutes.chromiumPerformance, HTTPRoutes.performance];
48 tags = [APITags.browserAPI];
49 async handler(
50 req: Request,
51 res: ServerResponse,
52 _logger: Logger,
53 browser: BrowserInstance,
54 ): Promise<void> {
55 const config = this.config();
56 const { url } = req.body as BodySchema;
57 assertNavigationAllowed(
58 url,
59 config.getBlockedURLPatterns(),
60 config.getBlockedNetworkRanges(),
61 );
62
63 const response = await main({
64 browser,
65 context: req.body as BodySchema,
66 logger: _logger,
67 timeout: config.getTimeout(),
68 });
69
70 return jsonResponse(res, 200, response);
71 }
72}

Callers

nothing calls this directly

Calls 6

assertNavigationAllowedFunction · 0.85
mainFunction · 0.85
jsonResponseFunction · 0.85
getBlockedURLPatternsMethod · 0.80
getTimeoutMethod · 0.45

Tested by

no test coverage detected