pg: also use firefox

Dropping chromium reduced image size by ~500MB from 1.55GB to 1.04GB.
This commit is contained in:
Ralf Vogler 2022-12-21 01:12:16 +01:00
parent 31fb97345e
commit 34393eec76
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
# Playwright
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD true
# === INSTALL Node.js ===
@ -47,7 +47,7 @@ COPY package*.json ./
# Install browser & dependencies only
RUN npm install \
&& npx playwright install --with-deps firefox chromium \
&& npx playwright install --with-deps firefox \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View file

@ -1,4 +1,4 @@
import { chromium } from 'playwright'; // stealth plugin needs no outdated playwright-extra
import { firefox } from 'playwright'; // stealth plugin needs no outdated playwright-extra
import path from 'path';
import { dirs, jsonDb, datetime, stealth, filenamify } from './util.js';
@ -22,7 +22,7 @@ const run = {
};
// https://playwright.dev/docs/auth#multi-factor-authentication
const context = await chromium.launchPersistentContext(dirs.browser, {
const context = await firefox.launchPersistentContext(dirs.browser, {
// channel: 'chrome', // https://playwright.dev/docs/browsers#google-chrome--microsoft-edge, chrome will not work on arm64 linux, only chromium which is the default
headless,
viewport: { width: 1280, height: 1280 },