From bce9439280671d0308b60b82822b8e05579bc5f6 Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 15:30:48 -0500 Subject: [PATCH 1/7] Update major dependencies --- CHANGELOG.md | 2 ++ Cargo.toml | 8 ++++---- chromiumoxide_fetcher/Cargo.toml | 10 ++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a6c92a..b55ab39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump CDP to `r1566079` - Use a struct `Arg` for arguments to combine flags automatically - Browser process no longer inherits stdout +- Update reqwest to 0.13 +- Update thiserror to 2 ### Added diff --git a/Cargo.toml b/Cargo.toml index 2855ceb..1a54ba9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["chrome", "chromedriver", "puppeteer", "automation"] categories = ["web-programming", "api-bindings", "development-tools::testing"] [dependencies] -async-tungstenite = { version = "0.32.0", features = ["tokio-runtime"] } +async-tungstenite = { version = "0.32", features = ["tokio-runtime"] } serde = { version = "1", features = ["derive"] } futures = "0.3" chromiumoxide_types = { path = "chromiumoxide_types", version = "0.8" } @@ -22,7 +22,7 @@ chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.8" } chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.8", default-features = false, optional = true } serde_json = "1" which = "8" -thiserror = "1" +thiserror = "2" url = "2" base64 = "0.22" fnv = "1" @@ -39,10 +39,10 @@ tracing = "0.1" pin-project-lite = "0.2" dunce = "1" bytes = { version = "1", features = ["serde"], optional = true } -reqwest = { version = "0.12", default-features = false } +reqwest = { version = "0.13", default-features = false } [target.'cfg(windows)'.dependencies] -windows-registry = "0.5" +windows-registry = "0.6" [dev-dependencies] quote = "1" diff --git a/chromiumoxide_fetcher/Cargo.toml b/chromiumoxide_fetcher/Cargo.toml index 9eb5366..7f1cc3f 100644 --- a/chromiumoxide_fetcher/Cargo.toml +++ b/chromiumoxide_fetcher/Cargo.toml @@ -22,20 +22,18 @@ path = "tests/lib.rs" harness = true [dev-dependencies] -reqwest = { version = "0.12", features = [ - "rustls-tls", -], default-features = false } +reqwest = { version = "0.13", features = ["rustls"], default-features = false } tokio = { version = "1", features = ["rt", "fs", "process", "macros"] } [dependencies] -thiserror = "1" +thiserror = "2" anyhow = "1" directories = "6" serde = { version = "1", features = ["derive"] } tracing = "0.1" zip = { version = "0.6", default-features = false, features = ["deflate"] } tokio = { version = "1", features = ["fs", "io-util"] } -reqwest = { version = "0.12", default-features = false, features = ["json"] } +reqwest = { version = "0.13", default-features = false, features = ["json"] } [target.'cfg(target_os = "windows")'.dependencies] windows-version = "0.1" @@ -43,5 +41,5 @@ windows-version = "0.1" [features] default = ["rustls"] -rustls = ["reqwest/rustls-tls"] +rustls = ["reqwest/rustls"] native-tls = ["reqwest/native-tls"] From 87aa047fe5c106c01f4e697faf83acf051d1543f Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 15:50:20 -0500 Subject: [PATCH 2/7] Add support for zip v8 --- CHANGELOG.md | 1 + chromiumoxide_fetcher/Cargo.toml | 9 +- chromiumoxide_fetcher/src/runtime/zip/mod.rs | 9 ++ .../src/runtime/{zip.rs => zip/zip_0_6.rs} | 2 +- .../src/runtime/zip/zip_8.rs | 111 ++++++++++++++++++ 5 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 chromiumoxide_fetcher/src/runtime/zip/mod.rs rename chromiumoxide_fetcher/src/runtime/{zip.rs => zip/zip_0_6.rs} (97%) create mode 100644 chromiumoxide_fetcher/src/runtime/zip/zip_8.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index b55ab39..00878d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Browser process no longer inherits stdout - Update reqwest to 0.13 - Update thiserror to 2 +- Add support for zip8 and make it default ### Added diff --git a/chromiumoxide_fetcher/Cargo.toml b/chromiumoxide_fetcher/Cargo.toml index 7f1cc3f..1eb0d37 100644 --- a/chromiumoxide_fetcher/Cargo.toml +++ b/chromiumoxide_fetcher/Cargo.toml @@ -31,7 +31,12 @@ anyhow = "1" directories = "6" serde = { version = "1", features = ["derive"] } tracing = "0.1" -zip = { version = "0.6", default-features = false, features = ["deflate"] } +zip-0_2 = { package = "zip", version = "0.6", default-features = false, features = [ + "deflate", +], optional = true } +zip-8 = { package = "zip", version = "8", default-features = false, features = [ + "deflate-flate2-zlib-rs", +], optional = true } tokio = { version = "1", features = ["fs", "io-util"] } reqwest = { version = "0.13", default-features = false, features = ["json"] } @@ -39,7 +44,7 @@ reqwest = { version = "0.13", default-features = false, features = ["json"] } windows-version = "0.1" [features] -default = ["rustls"] +default = ["rustls", "zip-8"] rustls = ["reqwest/rustls"] native-tls = ["reqwest/native-tls"] diff --git a/chromiumoxide_fetcher/src/runtime/zip/mod.rs b/chromiumoxide_fetcher/src/runtime/zip/mod.rs new file mode 100644 index 0000000..f115135 --- /dev/null +++ b/chromiumoxide_fetcher/src/runtime/zip/mod.rs @@ -0,0 +1,9 @@ +#[cfg(feature = "zip-0_2")] +mod zip_0_2; +#[cfg(feature = "zip-0_2")] +pub use zip_0_2::ZipArchive; + +#[cfg(feature = "zip-8")] +mod zip_8; +#[cfg(feature = "zip-8")] +pub use zip_8::ZipArchive; diff --git a/chromiumoxide_fetcher/src/runtime/zip.rs b/chromiumoxide_fetcher/src/runtime/zip/zip_0_6.rs similarity index 97% rename from chromiumoxide_fetcher/src/runtime/zip.rs rename to chromiumoxide_fetcher/src/runtime/zip/zip_0_6.rs index 1b3b721..ec33865 100644 --- a/chromiumoxide_fetcher/src/runtime/zip.rs +++ b/chromiumoxide_fetcher/src/runtime/zip/zip_0_6.rs @@ -102,7 +102,7 @@ fn create_symlink(link_target: Vec, link_path: &Path) -> ZipResult<()> { fn create_symlink(link_target: Vec, link_path: &Path) -> ZipResult<()> { // Only supports UTF-8 paths which is enough for our usecase let link_target = String::from_utf8(link_target) - .map_err(|_| ZipError::InvalidArchive("Invalid synmlink target name"))?; + .map_err(|_| ZipError::InvalidArchive("Invalid symlink target name"))?; std::os::windows::fs::symlink_file(link_target, link_path)?; Ok(()) diff --git a/chromiumoxide_fetcher/src/runtime/zip/zip_8.rs b/chromiumoxide_fetcher/src/runtime/zip/zip_8.rs new file mode 100644 index 0000000..d787801 --- /dev/null +++ b/chromiumoxide_fetcher/src/runtime/zip/zip_8.rs @@ -0,0 +1,111 @@ +use std::fs; +use std::io::{self, Read, Seek}; +use std::ops::{Deref, DerefMut}; +use std::path::Path; + +use zip_8::{ + read::ZipFile, + result::{ZipError, ZipResult}, +}; + +#[derive(Clone, Debug)] +pub struct ZipArchive(zip_8::ZipArchive); + +impl Deref for ZipArchive { + type Target = zip_8::ZipArchive; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for ZipArchive { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl ZipArchive { + pub fn new(reader: R) -> ZipResult { + zip_8::ZipArchive::new(reader).map(Self) + } + + /// We need this custom extract function to support symlinks. + /// This is based on https://github.com/zip-rs/zip/pull/213. + /// + /// We must be careful with this implementation since it is not + /// protected against malicious symlinks, but we trust the binaries + /// provided by chromium. + pub fn extract>(&mut self, directory: P) -> ZipResult<()> { + for i in 0..self.len() { + let mut file = self.by_index(i)?; + + let filepath = file + .enclosed_name() + .ok_or(ZipError::InvalidArchive("Invalid file path".into()))?; + let outpath = directory.as_ref().join(filepath); + + if file.is_dir() { + fs::create_dir_all(&outpath)?; + } else { + if let Some(p) = outpath.parent() { + if !p.exists() { + fs::create_dir_all(p)?; + } + } + + match read_symlink(&mut file)? { + Some(target) => { + create_symlink(target, &outpath)?; + } + None => { + let mut outfile = fs::File::create(&outpath)?; + io::copy(&mut file, &mut outfile)?; + + // Get and Set permissions + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + if let Some(mode) = file.unix_mode() { + fs::set_permissions(&outpath, fs::Permissions::from_mode(mode))?; + } + } + } + } + } + } + Ok(()) + } +} + +fn read_symlink(entry: &mut ZipFile<'_, R>) -> ZipResult>> { + if let Some(mode) = entry.unix_mode() { + const S_IFLNK: u32 = 0o120000; // symbolic link + if mode & S_IFLNK == S_IFLNK { + let mut contents = Vec::new(); + entry.read_to_end(&mut contents)?; + return Ok(Some(contents)); + } + } + Ok(None) +} + +#[cfg(target_family = "unix")] +fn create_symlink(link_target: Vec, link_path: &Path) -> ZipResult<()> { + use std::os::unix::ffi::OsStringExt as _; + + let link_target = std::ffi::OsString::from_vec(link_target); + std::os::unix::fs::symlink(link_target, link_path)?; + + Ok(()) +} + +#[cfg(target_family = "windows")] +fn create_symlink(link_target: Vec, link_path: &Path) -> ZipResult<()> { + // Only supports UTF-8 paths which is enough for our usecase + let link_target = String::from_utf8(link_target) + .map_err(|_| ZipError::InvalidArchive("Invalid symlink target name".into()))?; + std::os::windows::fs::symlink_file(link_target, link_path)?; + + Ok(()) +} From 7acbae460286a75178a3fcf57e3ad1c36b4196f8 Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 16:24:59 -0500 Subject: [PATCH 3/7] Fix bad feature --- chromiumoxide_fetcher/Cargo.toml | 2 +- chromiumoxide_fetcher/src/runtime/zip/mod.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chromiumoxide_fetcher/Cargo.toml b/chromiumoxide_fetcher/Cargo.toml index 1eb0d37..7c4c181 100644 --- a/chromiumoxide_fetcher/Cargo.toml +++ b/chromiumoxide_fetcher/Cargo.toml @@ -31,7 +31,7 @@ anyhow = "1" directories = "6" serde = { version = "1", features = ["derive"] } tracing = "0.1" -zip-0_2 = { package = "zip", version = "0.6", default-features = false, features = [ +zip-0_6 = { package = "zip", version = "0.6", default-features = false, features = [ "deflate", ], optional = true } zip-8 = { package = "zip", version = "8", default-features = false, features = [ diff --git a/chromiumoxide_fetcher/src/runtime/zip/mod.rs b/chromiumoxide_fetcher/src/runtime/zip/mod.rs index f115135..38a9012 100644 --- a/chromiumoxide_fetcher/src/runtime/zip/mod.rs +++ b/chromiumoxide_fetcher/src/runtime/zip/mod.rs @@ -1,6 +1,6 @@ -#[cfg(feature = "zip-0_2")] -mod zip_0_2; -#[cfg(feature = "zip-0_2")] +#[cfg(feature = "zip-0_6")] +mod zip_0_6; +#[cfg(feature = "zip-0_6")] pub use zip_0_2::ZipArchive; #[cfg(feature = "zip-8")] From 446e09cbd95095bb6b71263bb53cf42e35c95856 Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 16:38:41 -0500 Subject: [PATCH 4/7] Remove serde0 feature, bump tp 0.9.0 --- Cargo.toml | 10 +- chromiumoxide_cdp/Cargo.toml | 10 +- chromiumoxide_fetcher/Cargo.toml | 8 +- chromiumoxide_fetcher/src/runtime/zip/mod.rs | 16 +-- .../src/runtime/zip/{zip_0_6.rs => zip0.rs} | 0 .../src/runtime/zip/{zip_8.rs => zip8.rs} | 8 +- chromiumoxide_pdl/Cargo.toml | 8 +- chromiumoxide_pdl/src/pdl/mod.rs | 98 +++++++++---------- chromiumoxide_types/Cargo.toml | 2 +- 9 files changed, 79 insertions(+), 81 deletions(-) rename chromiumoxide_fetcher/src/runtime/zip/{zip_0_6.rs => zip0.rs} (100%) rename chromiumoxide_fetcher/src/runtime/zip/{zip_8.rs => zip8.rs} (95%) diff --git a/Cargo.toml b/Cargo.toml index 1a54ba9..f7f4aac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide" -version = "0.8.0" +version = "0.9.0" rust-version = "1.85" autotests = false authors = ["Matthias Seitz "] @@ -17,9 +17,9 @@ categories = ["web-programming", "api-bindings", "development-tools::testing"] async-tungstenite = { version = "0.32", features = ["tokio-runtime"] } serde = { version = "1", features = ["derive"] } futures = "0.3" -chromiumoxide_types = { path = "chromiumoxide_types", version = "0.8" } -chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.8" } -chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.8", default-features = false, optional = true } +chromiumoxide_types = { path = "chromiumoxide_types", version = "0.9" } +chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.9" } +chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.9", default-features = false, optional = true } serde_json = "1" which = "8" thiserror = "2" @@ -55,11 +55,11 @@ tokio = { version = "1", features = ["rt-multi-thread", "time", "macros"] } default = ["bytes"] fetcher = ["chromiumoxide_fetcher"] bytes = ["dep:bytes"] -serde0 = [] rustls = ["chromiumoxide_fetcher/rustls"] native-tls = ["chromiumoxide_fetcher/native-tls"] + [[example]] name = "fetcher" required-features = ["fetcher"] diff --git a/chromiumoxide_cdp/Cargo.toml b/chromiumoxide_cdp/Cargo.toml index 1cc82a1..d81a7ef 100644 --- a/chromiumoxide_cdp/Cargo.toml +++ b/chromiumoxide_cdp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_cdp" -version = "0.8.0" +version = "0.9.0" authors = ["Matthias Seitz "] edition = "2024" rust-version = "1.85" @@ -11,16 +11,14 @@ repository = "https://github.com/mattsse/chromiumoxide" readme = "../README.md" include = ["src/**/*", "*.pdl", "LICENSE-*"] -[features] -serde0 = [] [dev-dependencies] -chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.8" } +chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.9" } ureq = "2.10.0" tempfile = "3.10.1" [dependencies] -chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.8" } -chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.8" } +chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.9" } +chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.9" } serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/chromiumoxide_fetcher/Cargo.toml b/chromiumoxide_fetcher/Cargo.toml index 7c4c181..3ba6f55 100644 --- a/chromiumoxide_fetcher/Cargo.toml +++ b/chromiumoxide_fetcher/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_fetcher" -version = "0.8.0" +version = "0.9.0" authors = ["Matthias Seitz "] edition = "2024" rust-version = "1.85" @@ -31,10 +31,10 @@ anyhow = "1" directories = "6" serde = { version = "1", features = ["derive"] } tracing = "0.1" -zip-0_6 = { package = "zip", version = "0.6", default-features = false, features = [ +zip0 = { package = "zip", version = "0.6", default-features = false, features = [ "deflate", ], optional = true } -zip-8 = { package = "zip", version = "8", default-features = false, features = [ +zip8 = { package = "zip", version = "8", default-features = false, features = [ "deflate-flate2-zlib-rs", ], optional = true } tokio = { version = "1", features = ["fs", "io-util"] } @@ -44,7 +44,7 @@ reqwest = { version = "0.13", default-features = false, features = ["json"] } windows-version = "0.1" [features] -default = ["rustls", "zip-8"] +default = ["rustls", "zip8"] rustls = ["reqwest/rustls"] native-tls = ["reqwest/native-tls"] diff --git a/chromiumoxide_fetcher/src/runtime/zip/mod.rs b/chromiumoxide_fetcher/src/runtime/zip/mod.rs index 38a9012..b42e00e 100644 --- a/chromiumoxide_fetcher/src/runtime/zip/mod.rs +++ b/chromiumoxide_fetcher/src/runtime/zip/mod.rs @@ -1,9 +1,9 @@ -#[cfg(feature = "zip-0_6")] -mod zip_0_6; -#[cfg(feature = "zip-0_6")] -pub use zip_0_2::ZipArchive; +#[cfg(feature = "zip0")] +mod zip0; +#[cfg(feature = "zip0")] +pub use zip0::ZipArchive; -#[cfg(feature = "zip-8")] -mod zip_8; -#[cfg(feature = "zip-8")] -pub use zip_8::ZipArchive; +#[cfg(feature = "zip8")] +mod zip8; +#[cfg(feature = "zip8")] +pub use zip8::ZipArchive; diff --git a/chromiumoxide_fetcher/src/runtime/zip/zip_0_6.rs b/chromiumoxide_fetcher/src/runtime/zip/zip0.rs similarity index 100% rename from chromiumoxide_fetcher/src/runtime/zip/zip_0_6.rs rename to chromiumoxide_fetcher/src/runtime/zip/zip0.rs diff --git a/chromiumoxide_fetcher/src/runtime/zip/zip_8.rs b/chromiumoxide_fetcher/src/runtime/zip/zip8.rs similarity index 95% rename from chromiumoxide_fetcher/src/runtime/zip/zip_8.rs rename to chromiumoxide_fetcher/src/runtime/zip/zip8.rs index d787801..ecd33d0 100644 --- a/chromiumoxide_fetcher/src/runtime/zip/zip_8.rs +++ b/chromiumoxide_fetcher/src/runtime/zip/zip8.rs @@ -3,16 +3,16 @@ use std::io::{self, Read, Seek}; use std::ops::{Deref, DerefMut}; use std::path::Path; -use zip_8::{ +use zip8::{ read::ZipFile, result::{ZipError, ZipResult}, }; #[derive(Clone, Debug)] -pub struct ZipArchive(zip_8::ZipArchive); +pub struct ZipArchive(zip8::ZipArchive); impl Deref for ZipArchive { - type Target = zip_8::ZipArchive; + type Target = zip8::ZipArchive; fn deref(&self) -> &Self::Target { &self.0 @@ -27,7 +27,7 @@ impl DerefMut for ZipArchive { impl ZipArchive { pub fn new(reader: R) -> ZipResult { - zip_8::ZipArchive::new(reader).map(Self) + zip8::ZipArchive::new(reader).map(Self) } /// We need this custom extract function to support symlinks. diff --git a/chromiumoxide_pdl/Cargo.toml b/chromiumoxide_pdl/Cargo.toml index 8f5e50c..9672f85 100644 --- a/chromiumoxide_pdl/Cargo.toml +++ b/chromiumoxide_pdl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_pdl" -version = "0.8.0" +version = "0.9.0" authors = ["Matthias Seitz "] edition = "2024" rust-version = "1.85" @@ -18,9 +18,9 @@ quote = "1.0.10" proc-macro2 = "1.0.32" heck = "0.4" serde_json = "1" -serde = { version = "1", features = ["derive"] } -chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.8" } +serde = { version = "1", features = ["derive"], optional = true } +chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.9" } either = "1.6.1" [features] -serde0 = [] +serde = ["dep:serde"] diff --git a/chromiumoxide_pdl/src/pdl/mod.rs b/chromiumoxide_pdl/src/pdl/mod.rs index 7379e39..0b42efb 100644 --- a/chromiumoxide_pdl/src/pdl/mod.rs +++ b/chromiumoxide_pdl/src/pdl/mod.rs @@ -3,69 +3,69 @@ mod error; pub mod parser; pub mod resolver; -#[cfg(feature = "serde0")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -#[cfg(feature = "serde0")] +#[cfg(feature = "serde")] mod ser; use std::borrow::Cow; pub use self::error::Error; -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct Protocol<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing))] + #[cfg_attr(feature = "serde", serde(skip_serializing))] pub description: Option>, pub version: Version, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub domains: Vec>, } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct Version { - #[cfg_attr(feature = "serde0", serde(serialize_with = "ser::serialize_usize"))] + #[cfg_attr(feature = "serde", serde(serialize_with = "ser::serialize_usize"))] pub major: usize, - #[cfg_attr(feature = "serde0", serde(serialize_with = "ser::serialize_usize"))] + #[cfg_attr(feature = "serde", serde(serialize_with = "ser::serialize_usize"))] pub minor: usize, } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Domain<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub description: Option>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub experimental: bool, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub deprecated: bool, - #[cfg_attr(feature = "serde0", serde(rename = "domain"))] + #[cfg_attr(feature = "serde", serde(rename = "domain"))] pub name: Cow<'a, str>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub dependencies: Vec>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub types: Vec>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub commands: Vec>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub events: Vec>, } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct TypeDef<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub description: Option>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub experimental: bool, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub deprecated: bool, pub name: Cow<'a, str>, - #[cfg_attr(feature = "serde0", serde(flatten))] + #[cfg_attr(feature = "serde", serde(flatten))] pub extends: Type<'a>, - #[cfg_attr(feature = "serde0", serde(flatten))] + #[cfg_attr(feature = "serde", serde(flatten))] pub item: Option>, // RawType is the raw type. pub raw_name: Cow<'a, str>, @@ -79,7 +79,7 @@ impl<'a> TypeDef<'a> { } } -#[cfg_attr(feature = "serde0", derive(Deserialize))] +#[cfg_attr(feature = "serde", derive(Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub enum Type<'a> { Integer, @@ -126,19 +126,19 @@ impl Type<'_> { } } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "serde0", serde(rename_all = "lowercase"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "lowercase"))] #[derive(Clone, Debug, PartialEq, Eq)] pub enum Item<'a> { - #[cfg_attr(feature = "serde0", serde(serialize_with = "ser::serialize_enum"))] + #[cfg_attr(feature = "serde", serde(serialize_with = "ser::serialize_enum"))] Enum(Vec>), Properties(Vec>), } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Variant<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub description: Option>, pub name: Cow<'a, str>, } @@ -152,18 +152,18 @@ impl<'a> Variant<'a> { } } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Param<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub description: Option>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub experimental: bool, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub deprecated: bool, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub optional: bool, - #[cfg_attr(feature = "serde0", serde(flatten))] + #[cfg_attr(feature = "serde", serde(flatten))] pub r#type: Type<'a>, pub name: Cow<'a, str>, // RawType is the raw type. @@ -172,22 +172,22 @@ pub struct Param<'a> { pub is_circular_dep: bool, } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Command<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub description: Option>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub experimental: bool, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub deprecated: bool, pub name: Cow<'a, str>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] - #[cfg_attr(feature = "serde0", serde(serialize_with = "ser::serialize_redirect"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(serialize_with = "ser::serialize_redirect"))] pub redirect: Option>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub parameters: Vec>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub returns: Vec>, // RawType is the raw type. pub raw_name: Cow<'a, str>, @@ -195,17 +195,17 @@ pub struct Command<'a> { pub is_circular_dep: bool, } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Event<'a> { - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Option::is_none"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub description: Option>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub experimental: bool, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "ser::is_false"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "ser::is_false"))] pub deprecated: bool, pub name: Cow<'a, str>, - #[cfg_attr(feature = "serde0", serde(skip_serializing_if = "Vec::is_empty"))] + #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Vec::is_empty"))] pub parameters: Vec>, // RawType is the raw type. pub raw_name: Cow<'a, str>, @@ -213,7 +213,7 @@ pub struct Event<'a> { pub is_circular_dep: bool, } -#[cfg_attr(feature = "serde0", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Redirect<'a> { pub description: Option>, diff --git a/chromiumoxide_types/Cargo.toml b/chromiumoxide_types/Cargo.toml index 77e57ff..2313f66 100644 --- a/chromiumoxide_types/Cargo.toml +++ b/chromiumoxide_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_types" -version = "0.8.0" +version = "0.9.0" authors = ["Matthias Seitz "] edition = "2024" description = "Contains the essential types necessary for using chromiumoxide" From 4db8307806b548b433e39fcfa10eb1390015a01f Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 16:40:34 -0500 Subject: [PATCH 5/7] Fix build features for example --- Cargo.toml | 4 +++- README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f7f4aac..8054673 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,10 +59,12 @@ bytes = ["dep:bytes"] rustls = ["chromiumoxide_fetcher/rustls"] native-tls = ["chromiumoxide_fetcher/native-tls"] +zip0 = ["chromiumoxide_fetcher/zip0"] +zip8 = ["chromiumoxide_fetcher/zip8"] [[example]] name = "fetcher" -required-features = ["fetcher"] +required-features = ["fetcher", "zip8", "rustls"] [[test]] name = "chromiumoxide_tests" diff --git a/README.md b/README.md index e89bc47..9c11088 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ All Events are bundled in single enum (`CdpEvent`) By default `chromiumoxide` will try to find an installed version of chromium on the computer it runs on. It is possible to download and install one automatically for some platforms using the `fetcher` feature. -You need to enable either the `rustls` or the `native-tls` feature to allow the fetcher to download binaries. +You need to enable either the `rustls` or the `native-tls` feature and the `zip0` or `zip8` feature to allow the fetcher to download binaries. ```rust use std::path::Path; From 70a684aa8788771a90e2adcc263a2e347795f23e Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 16:51:37 -0500 Subject: [PATCH 6/7] Update heck, remove ureq --- chromiumoxide_cdp/Cargo.toml | 5 +++-- chromiumoxide_cdp/tests/generate.rs | 30 ++++++++++++++++------------- chromiumoxide_pdl/Cargo.toml | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/chromiumoxide_cdp/Cargo.toml b/chromiumoxide_cdp/Cargo.toml index d81a7ef..cd4ad5d 100644 --- a/chromiumoxide_cdp/Cargo.toml +++ b/chromiumoxide_cdp/Cargo.toml @@ -14,8 +14,9 @@ include = ["src/**/*", "*.pdl", "LICENSE-*"] [dev-dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.9" } -ureq = "2.10.0" -tempfile = "3.10.1" +reqwest = { version = "0.13", features = ["rustls"], default-features = false } +tempfile = "3.10" +tokio = { version = "1", features = ["rt", "fs", "process", "macros"] } [dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.9" } diff --git a/chromiumoxide_cdp/tests/generate.rs b/chromiumoxide_cdp/tests/generate.rs index 80c3a5c..de620ed 100644 --- a/chromiumoxide_cdp/tests/generate.rs +++ b/chromiumoxide_cdp/tests/generate.rs @@ -35,8 +35,8 @@ fn generated_code_is_fresh() { } /// Check that the PDL files are up to date -#[test] -fn pdl_is_fresh() { +#[tokio::test] +async fn pdl_is_fresh() { const BASE_URL: &str = "https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol"; let dir = Path::new(env!("CARGO_MANIFEST_DIR")); @@ -48,12 +48,13 @@ fn pdl_is_fresh() { .unwrap_or_else(|_| dir.join("pdl/js_protocol.pdl")); let js_proto_old = fs::read_to_string(&js_proto).unwrap_or_default(); - let js_proto_new = ureq::get(&format!( + let js_proto_new = reqwest::get(&format!( "{BASE_URL}/{CURRENT_REVISION}/pdl/js_protocol.pdl", )) - .call() + .await .unwrap() - .into_string() + .text() + .await .unwrap(); assert!(js_proto_new.contains("The Chromium Authors")); @@ -68,12 +69,13 @@ fn pdl_is_fresh() { .unwrap_or_else(|_| dir.join("pdl/browser_protocol.pdl")); let browser_proto_old = fs::read_to_string(&browser_proto).unwrap_or_default(); - let browser_proto_new = ureq::get(&format!( + let browser_proto_new = reqwest::get(&format!( "{BASE_URL}/{CURRENT_REVISION}/pdl/browser_protocol.pdl" )) - .call() + .await .unwrap() - .into_string() + .text() + .await .unwrap(); assert!(browser_proto_new.contains("The Chromium Authors")); @@ -95,11 +97,13 @@ fn pdl_is_fresh() { let include_path = dir.join("pdl").join(include); let include_proto_old = fs::read_to_string(&include_path).unwrap_or_default(); - let include_proto_new = ureq::get(&format!("{BASE_URL}/{CURRENT_REVISION}/pdl/{include}")) - .call() - .unwrap() - .into_string() - .unwrap(); + let include_proto_new = + reqwest::get(&format!("{BASE_URL}/{CURRENT_REVISION}/pdl/{include}")) + .await + .unwrap() + .text() + .await + .unwrap(); assert!(include_proto_new.contains("The Chromium Authors")); if include_proto_new != include_proto_old { diff --git a/chromiumoxide_pdl/Cargo.toml b/chromiumoxide_pdl/Cargo.toml index 9672f85..0d15043 100644 --- a/chromiumoxide_pdl/Cargo.toml +++ b/chromiumoxide_pdl/Cargo.toml @@ -16,7 +16,7 @@ once_cell = "1.8.0" regex = "1.5.4" quote = "1.0.10" proc-macro2 = "1.0.32" -heck = "0.4" +heck = "0.5" serde_json = "1" serde = { version = "1", features = ["derive"], optional = true } chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.9" } From 9348ba9934a1f914dc56d5b25cc9d2426c08fc0e Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 20 Feb 2026 16:55:57 -0500 Subject: [PATCH 7/7] Fix CI --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 7 ++++--- chromiumoxide_pdl/Cargo.toml | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ddbc2f..8109f64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,4 +84,4 @@ jobs: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - name: Check examples - run: cargo check --examples --features fetcher + run: cargo check --examples --features fetcher,zip8,rustls diff --git a/CHANGELOG.md b/CHANGELOG.md index 00878d2..4405ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,9 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump CDP to `r1566079` - Use a struct `Arg` for arguments to combine flags automatically - Browser process no longer inherits stdout -- Update reqwest to 0.13 -- Update thiserror to 2 -- Add support for zip8 and make it default +- Update `reqwest` to v0.13 +- Update `thiserror` to v2 +- Update `heck` to v0.5 +- Add support for `zip` v8 and make it default ### Added diff --git a/chromiumoxide_pdl/Cargo.toml b/chromiumoxide_pdl/Cargo.toml index 0d15043..3a79f32 100644 --- a/chromiumoxide_pdl/Cargo.toml +++ b/chromiumoxide_pdl/Cargo.toml @@ -12,15 +12,15 @@ readme = "../README.md" include = ["src/**/*", "LICENSE-*"] [dependencies] -once_cell = "1.8.0" -regex = "1.5.4" -quote = "1.0.10" -proc-macro2 = "1.0.32" +once_cell = "1.8" +regex = "1.5" +quote = "1" +proc-macro2 = "1" heck = "0.5" serde_json = "1" serde = { version = "1", features = ["derive"], optional = true } chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.9" } -either = "1.6.1" +either = "1.6" [features] serde = ["dep:serde"]