opt-in to "new headless"

This commit is contained in:
Egor Aristov 2025-02-15 11:05:04 +03:00
parent 09e5c805e3
commit a3c016fc84
2 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@ RUN go mod download
RUN PWGO_VER=$(grep -oE "playwright-go v\S+" go.mod | sed 's/playwright-go //g') \ RUN PWGO_VER=$(grep -oE "playwright-go v\S+" go.mod | sed 's/playwright-go //g') \
&& go install github.com/playwright-community/playwright-go/cmd/playwright@${PWGO_VER} && go install github.com/playwright-community/playwright-go/cmd/playwright@${PWGO_VER}
RUN playwright install --with-deps chromium && \ RUN playwright install --with-deps --no-shell chromium && \
mkdir /home/pwuser/.cache && \ mkdir /home/pwuser/.cache && \
mv /root/.cache/ms-playwright* /home/pwuser/.cache/ && \ mv /root/.cache/ms-playwright* /home/pwuser/.cache/ && \
chown -R pwuser:pwuser /home/pwuser/.cache && \ chown -R pwuser:pwuser /home/pwuser/.cache && \

View File

@ -51,6 +51,7 @@ func New(cfg Config) (*PwExtractor, error) {
return nil, fmt.Errorf("parse proxy: %w", err) return nil, fmt.Errorf("parse proxy: %w", err)
} }
e.chrome, err = e.pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{ e.chrome, err = e.pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
Channel: playwright.String("chromium"),
ChromiumSandbox: playwright.Bool(true), ChromiumSandbox: playwright.Bool(true),
HandleSIGINT: playwright.Bool(false), HandleSIGINT: playwright.Bool(false),
Proxy: proxy, Proxy: proxy,