Skip to content

Commit

Permalink
Fix browse_website headless mode for Firefox (Significant-Gravitas#…
Browse files Browse the repository at this point in the history
…2816)

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
  • Loading branch information
Irmius and Pwuts authored Apr 27, 2023
1 parent 3d89ed1 commit 6b4ad1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autogpt/commands/web_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:
)

if CFG.selenium_web_browser == "firefox":
if CFG.selenium_headless:
options.headless = True
options.add_argument("--disable-gpu")
driver = webdriver.Firefox(
executable_path=GeckoDriverManager().install(), options=options
)
Expand All @@ -92,7 +95,7 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:

options.add_argument("--no-sandbox")
if CFG.selenium_headless:
options.add_argument("--headless")
options.add_argument("--headless=new")
options.add_argument("--disable-gpu")

chromium_driver_path = Path("/usr/bin/chromedriver")
Expand Down
4 changes: 4 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Get your OpenAI API key from: [https://platform.openai.com/account/api-keys](htt
templates in the [repository].
6. Continue to [Run with Docker](#run-with-docker)

!!! note "Docker only supports headless browsing"
Auto-GPT uses a browser in headless mode by default: `HEADLESS_BROWSER=True`.
Please do not change this setting in combination with Docker, or Auto-GPT will crash.

[Docker Hub]: https://hub.docker.com/r/significantgravitas/auto-gpt
[repository]: https://github.com/Significant-Gravitas/Auto-GPT

Expand Down

0 comments on commit 6b4ad1f

Please sign in to comment.