Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Merge branch 'main' into never-relaunch

Nick Sweeting2e768bdc7ca0
diff --cc browser_use/agent/gif.py
index 9a5c18f6d,f79415cce..873f37bf7
--- a/browser_use/agent/gif.py
+++ b/browser_use/agent/gif.py
@@@ -61,17 -61,6 +61,18 @@@ def create_history_gif
logger.warning('No history or first screenshot to create GIF from')
return
+ # Find the first non-placeholder screenshot
+ first_real_screenshot = None
+ for item in history.history:
- if item.state.screenshot and item.state.screenshot != BLANK_PAGE_SCREENSHOT_PLACEHOLDER:
++ if item.state.screenshot and item.state.screenshot !=
++ :
+ first_real_screenshot = item.state.screenshot
+ break
+
+ if not first_real_screenshot:
+ logger.warning('No valid screenshots found (all are placeholders)')
+ return
+
# Try to load nicer fonts
try:
# Try different font options in order of preference
diff --cc browser_use/browser/session.py
index 723a4464f,5bfbe927d..39ffeaf2b
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@@ -26,11 -26,6 +26,7 @@@ from .utils import normalize_ur
os.environ['PW_TEST_SCREENSHOT_NO_FONTS_READY'] = '1' # https://github.com/microsoft/playwright/issues/35972
- # 4x4 white PNG placeholder for about:blank pages to save tokens
- BLANK_PAGE_SCREENSHOT_PLACEHOLDER = (
- 'iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAFElEQVR4nGP8//8/AwwwMSAB3BwAlm4DBfIlvvkAAAAASUVORK5CYII='
- )
+
import psutil
from bubus.helpers import retry
from playwright._impl._api_structures import ViewportSize