MCPcopy
hub / github.com/browserless/browserless / filterNonMacArm64Browsers

Method filterNonMacArm64Browsers

src/browserless.ts:145–167  ·  view source on GitHub ↗
(
    route:
      | HTTPRoute
      | BrowserHTTPRoute
      | WebSocketRoute
      | BrowserWebsocketRoute,
  )

Source from the content-addressed store, hash-verified

143 // Filter out routes that are not able to work on the arm64 architecture
144 // and log a message as to why that is (can't run Chrome on non-apple arm64)
145 protected filterNonMacArm64Browsers(
146 route:
147 | HTTPRoute
148 | BrowserHTTPRoute
149 | WebSocketRoute
150 | BrowserWebsocketRoute,
151 ) {
152 if (
153 isArm64 &&
154 !isMacOS &&
155 'browser' in route &&
156 route.browser &&
157 unavailableARM64Browsers.some((b) =>
158 route.browser.name.toLowerCase().includes(b),
159 )
160 ) {
161 this.logger.warn(
162 `Ignoring route "${route.path}" because it is not supported on arm64 platforms (route requires browser "${route.browser.name}").`,
163 );
164 return false;
165 }
166 return true;
167 }
168
169 protected async loadPwVersions(): Promise<void> {
170 // Consumer's package.json wins — downstream projects can declare their

Callers 1

startMethod · 0.95

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected