fix(js): scope fetch clients to browser contexts

This commit is contained in:
SGavrl committed 2026-07-26 10:20:25 +00:00
1 parent 4af658351d
commit ab6fa0e39b
3 files changed
+128 -28

No files matched your search

+9
View File
@@ -466,6 +466,15 @@ impl ObscuraHttpClient {
}).await
}
/// Clone the request client owned by this browser context.
///
/// Scripted fetch/XHR uses the same pool as navigation instead of a
/// process-global client. This keeps its async network state inside the
/// same ownership boundary as the V8 runtime (issue #453).
pub async fn request_client(&self) -> Client {
self.get_client().await.clone()
}
/// Read-only accessor for the proxy URL the client was configured with
/// (if any). Exposed so callers outside the `obscura-net` crate — notably
/// `op_fetch_url` in `obscura-js` (#139) — can route their own reqwest