mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-07 20:15:24 +00:00
Use Firefox ESR for Docker images
This commit is contained in:
parent
075b53ee24
commit
d16b982bb9
@ -5,9 +5,9 @@ ARG TARGETPLATFORM
|
|||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n"
|
RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n"
|
||||||
|
|
||||||
# Install the web browser (package firefox-esr is available too)
|
# Install the web browser (package firefox is available too)
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add --no-cache firefox dumb-init && \
|
apk add --no-cache firefox-esr dumb-init && \
|
||||||
rm -Rf /var/cache
|
rm -Rf /var/cache
|
||||||
|
|
||||||
# Copy FlareSolverr code
|
# Copy FlareSolverr code
|
||||||
|
@ -119,15 +119,14 @@ export async function create(session: string, options: SessionCreateOptions): Pr
|
|||||||
|
|
||||||
// todo: cookies can't be set in the session, you need to open the page first
|
// todo: cookies can't be set in the session, you need to open the page first
|
||||||
|
|
||||||
const args: string[] = [];
|
|
||||||
const puppeteerOptions: LaunchOptions = {
|
const puppeteerOptions: LaunchOptions = {
|
||||||
product: 'firefox',
|
product: 'firefox',
|
||||||
headless: process.env.HEADLESS !== 'false',
|
headless: process.env.HEADLESS !== 'false',
|
||||||
args
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug('Creating userDataDir for session.')
|
log.debug('Creating UserDataDir for session')
|
||||||
puppeteerOptions.userDataDir = prepareBrowserProfile(sessionId, options.proxy)
|
// note: puppeteerOptions.userDataDir only works in recent firefox versions
|
||||||
|
puppeteerOptions.args = ['--profile ' + prepareBrowserProfile(sessionId, options.proxy)];
|
||||||
|
|
||||||
// if we are running inside executable binary, change browser path
|
// if we are running inside executable binary, change browser path
|
||||||
if (typeof (process as any).pkg !== 'undefined') {
|
if (typeof (process as any).pkg !== 'undefined') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user