mirror of
https://github.com/browser-use/web-ui.git
synced 2026-03-22 11:17:17 +08:00
fix CHROME_PERSISTENT_SESSION error
This commit is contained in:
@@ -61,6 +61,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
||||
RUN playwright install --with-deps chromium
|
||||
RUN playwright install-deps
|
||||
RUN apt-get install -y google-chrome-stable
|
||||
|
||||
# Copy the application code
|
||||
COPY . .
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# @FileName: browser.py
|
||||
|
||||
import asyncio
|
||||
import pdb
|
||||
|
||||
from playwright.async_api import Browser as PlaywrightBrowser
|
||||
from playwright.async_api import (
|
||||
|
||||
@@ -17,7 +17,7 @@ def default_config():
|
||||
"llm_temperature": 1.0,
|
||||
"llm_base_url": "",
|
||||
"llm_api_key": "",
|
||||
"use_own_browser": False,
|
||||
"use_own_browser": os.getenv("CHROME_PERSISTENT_SESSION", False),
|
||||
"keep_browser_open": False,
|
||||
"headless": False,
|
||||
"disable_security": True,
|
||||
|
||||
@@ -58,7 +58,7 @@ startsecs=3
|
||||
depends_on=x11vnc
|
||||
|
||||
[program:persistent_browser]
|
||||
command=bash -c 'if [ "%(ENV_CHROME_PERSISTENT_SESSION)s" = "true" ]; then mkdir -p /app/data/chrome_data && sleep 8 && google-chrome --user-data-dir=/app/data/chrome_data --window-position=0,0 --window-size=%(ENV_RESOLUTION_WIDTH)s,%(ENV_RESOLUTION_HEIGHT)s --start-maximized --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --disable-setuid-sandbox --no-first-run --no-default-browser-check --no-experiments --ignore-certificate-errors --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 "data:text/html,<html><body style=\"background: \#f0f0f0; margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; font-family: Arial;\"><h1>Browser Ready for AI Interaction</h1></body></html>"; else echo "Persistent browser disabled"; fi'
|
||||
command=bash -c 'mkdir -p /app/data/chrome_data && sleep 8 && google-chrome --user-data-dir=/app/data/chrome_data --window-position=0,0 --window-size=%(ENV_RESOLUTION_WIDTH)s,%(ENV_RESOLUTION_HEIGHT)s --start-maximized --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --disable-setuid-sandbox --no-first-run --no-default-browser-check --no-experiments --ignore-certificate-errors --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 "data:text/html,<html><body style=\"background: \#f0f0f0; margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; font-family: Arial;\"><h1>Browser Ready for AI Interaction</h1></body></html>"'
|
||||
autorestart=%(ENV_CHROME_PERSISTENT_SESSION)s
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
|
||||
@@ -127,5 +127,5 @@ if __name__ == '__main__':
|
||||
# test_openai_model()
|
||||
# test_gemini_model()
|
||||
# test_azure_openai_model()
|
||||
# test_deepseek_model()
|
||||
test_ollama_model()
|
||||
test_deepseek_model()
|
||||
# test_ollama_model()
|
||||
|
||||
Reference in New Issue
Block a user