File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/scraper/middleware/components Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 4444 run : npm ci
4545
4646 - name : Run tests
47+ env :
48+ PLAYWRIGHT_LAUNCH_ARGS : ' --no-sandbox' # Add args needed for CI
4749 run : npm run test
4850
4951 build :
Original file line number Diff line number Diff line change @@ -17,8 +17,11 @@ export class HtmlPlaywrightMiddleware implements ContentProcessorMiddleware {
1717 */
1818 private async ensureBrowser ( ) : Promise < Browser > {
1919 if ( ! this . browser || ! this . browser . isConnected ( ) ) {
20- logger . debug ( "Launching new Playwright browser instance (Chromium)..." ) ;
21- this . browser = await chromium . launch ( ) ;
20+ const launchArgs = process . env . PLAYWRIGHT_LAUNCH_ARGS ?. split ( " " ) ?? [ ] ;
21+ logger . debug (
22+ `Launching new Playwright browser instance (Chromium) with args: ${ launchArgs . join ( " " ) || "none" } ...` ,
23+ ) ;
24+ this . browser = await chromium . launch ( { args : launchArgs } ) ;
2225 this . browser . on ( "disconnected" , ( ) => {
2326 logger . debug ( "Playwright browser instance disconnected." ) ;
2427 this . browser = null ;
You can’t perform that action at this time.
0 commit comments