Skip to content

The agent that turns websites into APIs!

fix: change HAR recording content mode to embed and optimize HAR file saving

Muhammed Mustafa AKSAM35a284967c88
diff --git a/src/reverse_api/browser.py b/src/reverse_api/browser.py
index 84b745c..1c8bdc6 100644
--- a/src/reverse_api/browser.py
+++ b/src/reverse_api/browser.py
@@ -455,7 +455,7 @@ class ManualBrowser:
channel="chrome", # Use real Chrome binary
headless=False,
record_har_path=str(self.har_path),
- record_har_content="attach",
+ record_har_content="embed",
no_viewport=True,
args=[
"--start-maximized",
@@ -542,7 +542,7 @@ class ManualBrowser:
# Create context with HAR recording and realistic settings
self._context = self._browser.new_context(
record_har_path=str(self.har_path),
- record_har_content="attach",
+ record_har_content="embed",
no_viewport=True,
locale="en-US",
timezone_id="America/New_York",
@@ -953,7 +953,7 @@ class AgentBrowser:
browser = Browser(
record_har_path=str(self.har_path),
record_har_mode="full",
- record_har_content="attach",
+ record_har_content="embed",
)
suppress_browser_use_logs()
diff --git a/src/reverse_api/native_host.py b/src/reverse_api/native_host.py
index 3d1edc8..20aaca4 100644
--- a/src/reverse_api/native_host.py
+++ b/src/reverse_api/native_host.py
@@ -356,7 +356,8 @@ class NativeHostHandler:
har_dir.mkdir(parents=True, exist_ok=True)
har_path = har_dir / "recording.har"
- har_path.write_text(json.dumps(har_data, indent=2))
+ # Save without indentation for performance (HAR files can be very large)
+ har_path.write_text(json.dumps(har_data, separators=(',', ':')))
self.current_run_id = run_id