full native (#754)
* full native * fix: apply cargo fmt formatting * fix: prevent zip path traversal in Chromium installer Use enclosed_name() to sanitize zip entry paths, preventing malicious archives from writing outside the extraction directory. * improvements * fix: apply cargo fmt formatting * benchmarks * bench * updates * fixes
This commit is contained in:
@@ -160,7 +160,7 @@ impl BrowserProcess {
|
||||
}
|
||||
|
||||
pub struct BrowserManager {
|
||||
pub client: CdpClient,
|
||||
pub client: Arc<CdpClient>,
|
||||
browser_process: Option<BrowserProcess>,
|
||||
ws_url: String,
|
||||
pages: Vec<PageInfo>,
|
||||
@@ -226,7 +226,7 @@ impl BrowserManager {
|
||||
let manager = if engine == "lightpanda" {
|
||||
initialize_lightpanda_manager(ws_url, process).await?
|
||||
} else {
|
||||
let client = CdpClient::connect(&ws_url).await?;
|
||||
let client = Arc::new(CdpClient::connect(&ws_url).await?);
|
||||
let mut manager = Self {
|
||||
client,
|
||||
browser_process: Some(process),
|
||||
@@ -290,7 +290,7 @@ impl BrowserManager {
|
||||
|
||||
pub async fn connect_cdp(url: &str) -> Result<Self, String> {
|
||||
let ws_url = resolve_cdp_url(url).await?;
|
||||
let client = CdpClient::connect(&ws_url).await?;
|
||||
let client = Arc::new(CdpClient::connect(&ws_url).await?);
|
||||
let mut manager = Self {
|
||||
client,
|
||||
browser_process: None,
|
||||
@@ -1173,7 +1173,7 @@ async fn initialize_lightpanda_manager(
|
||||
};
|
||||
|
||||
let mut manager = BrowserManager {
|
||||
client,
|
||||
client: Arc::new(client),
|
||||
browser_process: None,
|
||||
ws_url: ws_url.clone(),
|
||||
pages: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user