Skip to content

The headless browser for AI agents and web scraping

Merge main and document file access configuration

SGavrld5172685741c
diff --cc crates/obscura-browser/src/context.rs
index fbfefd89,fb68a9cc..02674022
--- a/crates/obscura-browser/src/context.rs
+++ b/crates/obscura-browser/src/context.rs
@@@ -29,6 -29,6 +29,7 @@@ pub struct BrowserContext
/// so every CDP and MCP route is covered; the CLI's own `obscura fetch
/// file://...` opts its local context in. A page can never drive
/// itself from a web origin into file:// regardless of this flag.
++ /// Use `set_allow_file_access` to keep the transport permission in sync.
pub allow_file_access: bool,
pub storage_dir: Option<PathBuf>,
/// When true, the http client allows fetching localhost / RFC1918 /
diff --cc docs/Use-as-a-Rust-library.md
index acb49400,acb49400..bcd8192c
--- a/docs/Use-as-a-Rust-library.md
+++ b/docs/Use-as-a-Rust-library.md
@@@ -63,6 -63,6 +63,11 @@@ async fn main() -> anyhow::Result<()>
`CookieStore`: `set`, `get_all`, `get_for_url`, `save_to_file`, `load_from_file`.
++Low-level `obscura-browser` users must call `BrowserContext::set_allow_file_access(true)`
++before sharing the context to read local files. Assigning `allow_file_access` directly
++does not enable the transport. Standalone `obscura-net` clients refuse `file://` by
++default; use their file-access setting only for trusted local-file workflows.
++
## Intercept requests
The interception API observes, blocks, mocks, and rewrites the requests a page makes, including JavaScript `fetch()` and XHR. Use it to capture API payloads while crawling, block trackers, or mock responses in tests.