From e7478aaa9583273dc5ab21a5269f0f31d454c10b Mon Sep 17 00:00:00 2001 From: Aleksey Vasilenko Date: Thu, 18 Apr 2024 05:01:29 +0300 Subject: [PATCH 01/12] Update winreg to 0.52 (#214) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 79c00d1e..72bd0138 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ bytes = { version = "1.4.0", features = ["serde"], optional = true } reqwest = { version = "0.11.20", default-features = false } [target.'cfg(windows)'.dependencies] -winreg = "0.51" +winreg = "0.52" [dev-dependencies] quote = "1" From c1c30fd039ead675dc4eed57b137f8b4aaed0214 Mon Sep 17 00:00:00 2001 From: Aleksey Vasilenko Date: Thu, 18 Apr 2024 05:01:48 +0300 Subject: [PATCH 02/12] Update base64 to 0.22 (#215) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 72bd0138..d390dd2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1" which = "4" thiserror = "1" url = "2" -base64 = "0.21" +base64 = "0.22" fnv = "1" futures-timer = "3" cfg-if = "1" From a798f0252f657439f33b73def20f0e47bf80bbc9 Mon Sep 17 00:00:00 2001 From: Aleksey Vasilenko Date: Thu, 18 Apr 2024 05:02:25 +0300 Subject: [PATCH 03/12] Update to reqwest 0.12 and async-tungstenite 0.25 (#211) --- Cargo.toml | 4 ++-- chromiumoxide_fetcher/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d390dd2a..1e48d975 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["chrome", "chromedriver", "puppeteer", "automation"] categories = ["web-programming", "api-bindings", "development-tools::testing"] [dependencies] -async-tungstenite = "0.23" +async-tungstenite = "0.25" serde = { version = "1", features = ["derive"] } async-std = { version = "1.5", features = [ "attributes", @@ -43,7 +43,7 @@ tracing = "0.1" pin-project-lite = "0.2" dunce = "1" bytes = { version = "1.4.0", features = ["serde"], optional = true } -reqwest = { version = "0.11.20", default-features = false } +reqwest = { version = "0.12", default-features = false } [target.'cfg(windows)'.dependencies] winreg = "0.52" diff --git a/chromiumoxide_fetcher/Cargo.toml b/chromiumoxide_fetcher/Cargo.toml index b81fe71c..43e9eca8 100644 --- a/chromiumoxide_fetcher/Cargo.toml +++ b/chromiumoxide_fetcher/Cargo.toml @@ -19,7 +19,7 @@ os_info = { version = "3", default-features = false } zip = { version = "0.6", default-features = false, features = ["deflate"] } async-std = { version = "1.5", features = ["unstable"], optional = true } tokio = { version = "1", features = ["fs"], optional = true } -reqwest = { version = "0.11", default-features = false, optional = true } +reqwest = { version = "0.12", default-features = false, optional = true } surf = { version = "2.3", default-features = false, optional = true } [features] From bd62ee35df3fad70d0b72e25faeed793bdab597c Mon Sep 17 00:00:00 2001 From: Peng-Yu Chen Date: Thu, 18 Apr 2024 03:02:47 +0100 Subject: [PATCH 04/12] feat(browser): add support for the new headless mode in BrowserConfig (#208) * feat(browser): add support for the new headless mode in BrowserConfig * miscellaneous enhancements following dda6ff * further fixes --- src/browser.rs | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/browser.rs b/src/browser.rs index 17dac756..903cc9ee 100644 --- a/src/browser.rs +++ b/src/browser.rs @@ -559,11 +559,22 @@ async fn ws_url_from_output( } } +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub enum HeadlessMode { + /// The "headful" mode. + False, + /// The old headless mode. + #[default] + True, + /// The new headless mode. See also: https://developer.chrome.com/docs/chromium/new-headless + New, +} + #[derive(Debug, Clone)] pub struct BrowserConfig { /// Determines whether to run headless version of the browser. Defaults to /// true. - headless: bool, + headless: HeadlessMode, /// Determines whether to run the browser with a sandbox. sandbox: bool, /// Launch the browser with a specific window width and height. @@ -619,7 +630,7 @@ pub struct BrowserConfig { #[derive(Debug, Clone)] pub struct BrowserConfigBuilder { - headless: bool, + headless: HeadlessMode, sandbox: bool, window_size: Option<(u32, u32)>, port: u16, @@ -652,7 +663,7 @@ impl BrowserConfig { impl Default for BrowserConfigBuilder { fn default() -> Self { Self { - headless: true, + headless: HeadlessMode::True, sandbox: true, window_size: None, port: 0, @@ -686,7 +697,17 @@ impl BrowserConfigBuilder { } pub fn with_head(mut self) -> Self { - self.headless = false; + self.headless = HeadlessMode::False; + self + } + + pub fn new_headless_mode(mut self) -> Self { + self.headless = HeadlessMode::New; + self + } + + pub fn headless_mode(mut self, mode: HeadlessMode) -> Self { + self.headless = mode; self } @@ -889,8 +910,16 @@ impl BrowserConfig { cmd.args(["--no-sandbox", "--disable-setuid-sandbox"]); } - if self.headless { - cmd.args(["--headless", "--hide-scrollbars", "--mute-audio"]); + match self.headless { + HeadlessMode::False => (), + HeadlessMode::True => { + cmd.args(["--headless", "--hide-scrollbars", "--mute-audio"]); + () + } + HeadlessMode::New => { + cmd.args(["--headless=new", "--hide-scrollbars", "--mute-audio"]); + () + } } if self.incognito { From 741abe127471b2bdffee9a05a4c0733db913929c Mon Sep 17 00:00:00 2001 From: Jeff Mendez Date: Tue, 28 May 2024 08:03:59 -0400 Subject: [PATCH 05/12] chore(deps): unpin bytes + serde (#221) * chore(deps): unpin bytes * chore(clippy): fix pdl multiple bound locations generate_struct * chore(clippy): fix cdp multiple bound locations downcast arc * chore(frame): fix inefficient name clone on navigate --- Cargo.toml | 2 +- chromiumoxide_cdp/Cargo.toml | 4 ++-- chromiumoxide_cdp/src/cdp.rs | 4 ++-- chromiumoxide_pdl/Cargo.toml | 4 ++-- chromiumoxide_pdl/src/build/generator.rs | 2 +- chromiumoxide_types/Cargo.toml | 4 ++-- src/browser.rs | 2 -- src/handler/frame.rs | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1e48d975..faf96179 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ tokio = { version = "1", features = [ tracing = "0.1" pin-project-lite = "0.2" dunce = "1" -bytes = { version = "1.4.0", features = ["serde"], optional = true } +bytes = { version = "1", features = ["serde"], optional = true } reqwest = { version = "0.12", default-features = false } [target.'cfg(windows)'.dependencies] diff --git a/chromiumoxide_cdp/Cargo.toml b/chromiumoxide_cdp/Cargo.toml index 88d41422..6c0730a6 100644 --- a/chromiumoxide_cdp/Cargo.toml +++ b/chromiumoxide_cdp/Cargo.toml @@ -19,5 +19,5 @@ tempfile = "3.2.0" [dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.5"} chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.5"} -serde = { version = "1.0.130", features = ["derive"] } -serde_json = "1.0.72" +serde = { version = "1", features = ["derive"] } +serde_json = "1" diff --git a/chromiumoxide_cdp/src/cdp.rs b/chromiumoxide_cdp/src/cdp.rs index ee5d3e27..9956269f 100644 --- a/chromiumoxide_cdp/src/cdp.rs +++ b/chromiumoxide_cdp/src/cdp.rs @@ -102,11 +102,11 @@ pub(crate) mod sealed { self.as_any().is::() } #[inline] - pub fn downcast_arc( + pub fn downcast_arc( self: ::std::sync::Arc, ) -> Result<::std::sync::Arc, ::std::sync::Arc> where - T: ::std::any::Any + Send + Sync, + T: ::std::any::Any + Send + Sync + SealedEvent, { if self.is::() { Ok(ArcAny::into_any_arc(self).downcast::().unwrap()) diff --git a/chromiumoxide_pdl/Cargo.toml b/chromiumoxide_pdl/Cargo.toml index c4306712..27c9dbbe 100644 --- a/chromiumoxide_pdl/Cargo.toml +++ b/chromiumoxide_pdl/Cargo.toml @@ -17,7 +17,7 @@ regex = "1.5.4" quote = "1.0.10" proc-macro2 = "1.0.32" heck = "0.4" -serde_json = "1.0.72" -serde = { version = "1.0.130", features = ["derive"] } +serde_json = "1" +serde = { version = "1", features = ["derive"] } chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.5"} either = "1.6.1" diff --git a/chromiumoxide_pdl/src/build/generator.rs b/chromiumoxide_pdl/src/build/generator.rs index 57bf1ab1..35fb68bb 100644 --- a/chromiumoxide_pdl/src/build/generator.rs +++ b/chromiumoxide_pdl/src/build/generator.rs @@ -567,7 +567,7 @@ impl Generator { /// Generates the struct definitions including enum definitions inner /// parameter enums - fn generate_struct<'a, T: 'a>( + fn generate_struct<'a, T>( &mut self, domain: &Domain, dt: &DomainDatatype, diff --git a/chromiumoxide_types/Cargo.toml b/chromiumoxide_types/Cargo.toml index 395983d2..fcdde489 100644 --- a/chromiumoxide_types/Cargo.toml +++ b/chromiumoxide_types/Cargo.toml @@ -11,5 +11,5 @@ readme = "../README.md" include = ["src/**/*", "LICENSE-*"] [dependencies] -serde = { version = "1.0.130", features = ["derive"] } -serde_json = "1.0.72" +serde = { version = "1", features = ["derive"] } +serde_json = "1" diff --git a/src/browser.rs b/src/browser.rs index 903cc9ee..ae229a22 100644 --- a/src/browser.rs +++ b/src/browser.rs @@ -914,11 +914,9 @@ impl BrowserConfig { HeadlessMode::False => (), HeadlessMode::True => { cmd.args(["--headless", "--hide-scrollbars", "--mute-audio"]); - () } HeadlessMode::New => { cmd.args(["--headless=new", "--hide-scrollbars", "--mute-audio"]); - () } } diff --git a/src/handler/frame.rs b/src/handler/frame.rs index 1a08255d..2759284c 100644 --- a/src/handler/frame.rs +++ b/src/handler/frame.rs @@ -113,7 +113,7 @@ impl Frame { } fn navigated(&mut self, frame: &CdpFrame) { - self.name = frame.name.clone(); + self.name.clone_from(&frame.name); let url = if let Some(ref fragment) = frame.url_fragment { format!("{}{fragment}", frame.url) } else { From 97f7b708935c093bbb36f1191f2dd71faa884f62 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 28 May 2024 16:41:17 +0200 Subject: [PATCH 06/12] chore: Release --- Cargo.toml | 8 ++++---- chromiumoxide_cdp/Cargo.toml | 8 ++++---- chromiumoxide_fetcher/Cargo.toml | 2 +- chromiumoxide_pdl/Cargo.toml | 4 ++-- chromiumoxide_types/Cargo.toml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index faf96179..05b5c3d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide" -version = "0.5.7" +version = "0.6.0" rust-version = "1.70" authors = ["Matthias Seitz "] edition = "2021" @@ -20,9 +20,9 @@ async-std = { version = "1.5", features = [ "unstable", ], optional = true } futures = "0.3" -chromiumoxide_types = { path = "chromiumoxide_types", version = "0.5" } -chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.5" } -chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.5", default-features = false, optional = true } +chromiumoxide_types = { path = "chromiumoxide_types", version = "0.6" } +chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.6" } +chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.6", default-features = false, optional = true } serde_json = "1" which = "4" thiserror = "1" diff --git a/chromiumoxide_cdp/Cargo.toml b/chromiumoxide_cdp/Cargo.toml index 6c0730a6..6db88caa 100644 --- a/chromiumoxide_cdp/Cargo.toml +++ b/chromiumoxide_cdp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_cdp" -version = "0.5.2" +version = "0.6.0" authors = ["Matthias Seitz "] edition = "2021" rust-version = "1.70" @@ -12,12 +12,12 @@ readme = "../README.md" include = ["src/**/*", "*.pdl", "LICENSE-*"] [dev-dependencies] -chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.5"} +chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.6" } ureq = "2.6.2" tempfile = "3.2.0" [dependencies] -chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.5"} -chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.5"} +chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.6" } +chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.6" } serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/chromiumoxide_fetcher/Cargo.toml b/chromiumoxide_fetcher/Cargo.toml index 43e9eca8..e58a338c 100644 --- a/chromiumoxide_fetcher/Cargo.toml +++ b/chromiumoxide_fetcher/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_fetcher" -version = "0.5.3" +version = "0.6.0" authors = ["Matthias Seitz "] edition = "2021" rust-version = "1.70" diff --git a/chromiumoxide_pdl/Cargo.toml b/chromiumoxide_pdl/Cargo.toml index 27c9dbbe..2a45eaa9 100644 --- a/chromiumoxide_pdl/Cargo.toml +++ b/chromiumoxide_pdl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_pdl" -version = "0.5.2" +version = "0.6.0" authors = ["Matthias Seitz "] edition = "2021" rust-version = "1.70" @@ -19,5 +19,5 @@ proc-macro2 = "1.0.32" heck = "0.4" serde_json = "1" serde = { version = "1", features = ["derive"] } -chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.5"} +chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.6" } either = "1.6.1" diff --git a/chromiumoxide_types/Cargo.toml b/chromiumoxide_types/Cargo.toml index fcdde489..fe24b06f 100644 --- a/chromiumoxide_types/Cargo.toml +++ b/chromiumoxide_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chromiumoxide_types" -version = "0.5.2" +version = "0.6.0" authors = ["Matthias Seitz "] edition = "2021" description = "Contains the essential types necessary for using chromiumoxide" From 0897fb5c8dd1708e40e3ee2d5fe5d70968d7d881 Mon Sep 17 00:00:00 2001 From: John Victor <137622345+johnvictor1965@users.noreply.github.com> Date: Mon, 8 Jul 2024 22:02:56 +0200 Subject: [PATCH 07/12] Expose more `Page` methods (#222) * `Page::authenticate()` * `Page::opener_id()` * Oops unused import --- src/handler/mod.rs | 14 +++++++------- src/handler/page.rs | 9 ++++++++- src/handler/target.rs | 28 ++++++++-------------------- src/page.rs | 16 ++++++++++++++++ 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/handler/mod.rs b/src/handler/mod.rs index c781de43..9c276905 100644 --- a/src/handler/mod.rs +++ b/src/handler/mod.rs @@ -431,13 +431,13 @@ impl Handler { .unwrap_or_else(|| self.default_browser_context.clone()); let target = Target::new( event.target_info, - TargetConfig::new( - self.config.ignore_https_errors, - self.config.request_timeout, - self.config.viewport.clone(), - self.config.request_intercept, - self.config.cache_enabled, - ), + TargetConfig { + ignore_https_errors: self.config.ignore_https_errors, + request_timeout: self.config.request_timeout, + viewport: self.config.viewport.clone(), + request_intercept: self.config.request_intercept, + cache_enabled: self.config.cache_enabled, + }, browser_ctx, ); self.target_ids.push(target.target_id().clone()); diff --git a/src/handler/page.rs b/src/handler/page.rs index 45cb88de..294317da 100644 --- a/src/handler/page.rs +++ b/src/handler/page.rs @@ -46,11 +46,12 @@ pub struct PageHandle { } impl PageHandle { - pub fn new(target_id: TargetId, session_id: SessionId) -> Self { + pub fn new(target_id: TargetId, session_id: SessionId, opener_id: Option) -> Self { let (commands, rx) = channel(1); let page = PageInner { target_id, session_id, + opener_id, sender: commands, }; Self { @@ -68,6 +69,7 @@ impl PageHandle { pub(crate) struct PageInner { target_id: TargetId, session_id: SessionId, + opener_id: Option, sender: Sender, } @@ -106,6 +108,11 @@ impl PageInner { &self.session_id } + /// The identifier of this page's target's opener target + pub fn opener_id(&self) -> &Option { + &self.opener_id + } + pub(crate) fn sender(&self) -> &Sender { &self.sender } diff --git a/src/handler/target.rs b/src/handler/target.rs index cfba904f..c96da4cf 100644 --- a/src/handler/target.rs +++ b/src/handler/target.rs @@ -18,6 +18,7 @@ use chromiumoxide_cdp::cdp::events::CdpEvent; use chromiumoxide_cdp::cdp::CdpEventMessage; use chromiumoxide_types::{Command, Method, Request, Response}; +use crate::auth::Credentials; use crate::cdp::browser_protocol::target::CloseTargetParams; use crate::cmd::CommandChain; use crate::cmd::CommandMessage; @@ -161,7 +162,8 @@ impl Target { fn create_page(&mut self) { if self.page.is_none() { if let Some(session) = self.session_id.clone() { - let handle = PageHandle::new(self.target_id().clone(), session); + let handle = + PageHandle::new(self.target_id().clone(), session, self.opener_id().cloned()); self.page = Some(handle); } } @@ -186,7 +188,7 @@ impl Target { } /// Get the target that opened this target. Top-level targets return `None`. - pub fn opener(&self) -> Option<&TargetId> { + pub fn opener_id(&self) -> Option<&TargetId> { self.info.opener_id.as_ref() } @@ -513,6 +515,9 @@ impl Target { let _ = tx.send(None); } } + TargetMessage::Authenticate(credentials) => { + self.network_manager.authenticate(credentials); + } } } } @@ -599,24 +604,6 @@ pub struct TargetConfig { pub cache_enabled: bool, } -impl TargetConfig { - pub fn new( - ignore_https_errors: bool, - request_timeout: Duration, - viewport: Option, - request_intercept: bool, - cache_enabled: bool, - ) -> Self { - Self { - ignore_https_errors, - request_timeout, - viewport, - request_intercept, - cache_enabled, - } - } -} - impl Default for TargetConfig { fn default() -> Self { Self { @@ -793,4 +780,5 @@ pub enum TargetMessage { AddEventListener(EventListenerRequest), /// Get the `ExecutionContext` if available GetExecutionContext(GetExecutionContext), + Authenticate(Credentials), } diff --git a/src/page.rs b/src/page.rs index 44e87195..79abb6c4 100644 --- a/src/page.rs +++ b/src/page.rs @@ -26,6 +26,7 @@ use chromiumoxide_cdp::cdp::js_protocol::runtime::{ use chromiumoxide_cdp::cdp::{browser_protocol, IntoEventKind}; use chromiumoxide_types::*; +use crate::auth::Credentials; use crate::element::Element; use crate::error::{CdpError, Result}; use crate::handler::commandfuture::CommandFuture; @@ -325,6 +326,11 @@ impl Page { self.inner.session_id() } + /// The identifier of the `Session` target of this page is attached to + pub fn opener_id(&self) -> &Option { + self.inner.opener_id() + } + /// Returns the name of the frame pub async fn frame_name(&self, frame_id: FrameId) -> Result> { let (tx, rx) = oneshot_channel(); @@ -339,6 +345,16 @@ impl Page { Ok(rx.await?) } + pub async fn authenticate(&self, credentials: Credentials) -> Result<()> { + self.inner + .sender() + .clone() + .send(TargetMessage::Authenticate(credentials)) + .await?; + + Ok(()) + } + /// Returns the current url of the page pub async fn url(&self) -> Result> { let (tx, rx) = oneshot_channel(); From 626798ddbfccebc33c967e246f6a28f8af213839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sampo=20Kivist=C3=B6?= <2021355+Havunen@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:11:56 +0300 Subject: [PATCH 08/12] Added an exmple how to use js bindings (#224) * Added an exmple how to use js bindings * rustmft --------- Co-authored-by: Matthias Seitz --- examples/js-binding-listener.rs | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 examples/js-binding-listener.rs diff --git a/examples/js-binding-listener.rs b/examples/js-binding-listener.rs new file mode 100644 index 00000000..2aaa06a0 --- /dev/null +++ b/examples/js-binding-listener.rs @@ -0,0 +1,50 @@ +use chromiumoxide::browser::{Browser, BrowserConfig}; +use chromiumoxide_cdp::cdp::js_protocol::runtime::{AddBindingParams, EventBindingCalled}; +use futures::StreamExt; +use std::sync::Arc; +use tokio::sync::Mutex; + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + + let (mut browser, mut handler) = + Browser::launch(BrowserConfig::builder().with_head().build()?).await?; + + let handle = async_std::task::spawn(async move { + while let Some(h) = handler.next().await { + match h { + Ok(_) => continue, + Err(_) => break, + } + } + }); + + let page = browser.new_page("about:blank").await?; + + let mut listener = page.event_listener::().await?; + + let value_from_js: Arc> = Arc::new(Mutex::new("".to_string())); + let value_from_js_clone = Arc::clone(&value_from_js); + + tokio::spawn(async move { + while let Some(event) = listener.next().await { + if event.name == "testFunc1" { + let mut locked_value = value_from_js_clone.lock().await; + *locked_value = event.payload.clone(); + } + } + }); + + page.execute(AddBindingParams::new("testFunc1")).await?; + + page.evaluate("window.testFunc1('30');").await?; + + let value = value_from_js.lock().await; + assert_eq!(*value, "30"); + + browser.close().await?; + handle.await; + + Ok(()) +} From fc7b4760a9d257db5f05b7c5b72f79b95f9fa0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sampo=20Kivist=C3=B6?= <2021355+Havunen@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:33:17 +0300 Subject: [PATCH 09/12] Roll to Chromium 129.0.6632.1 (r1336433) (#230) * Roll to Chromium 129.0.6632.1 (r1336433) * Fix lint error * Fixed build errors * Cargo fmt * Fix block-navigation example build error * cargo fmt * Lint fixes * Fix clippy warnings --- Cargo.toml | 5 +- chromiumoxide_cdp/Cargo.toml | 7 +- chromiumoxide_cdp/browser_protocol.pdl | 2882 +- chromiumoxide_cdp/js_protocol.pdl | 135 +- chromiumoxide_cdp/src/cdp.rs | 105324 +++++++++++--------- chromiumoxide_cdp/src/lib.rs | 7 +- chromiumoxide_pdl/Cargo.toml | 3 + chromiumoxide_pdl/src/build/generator.rs | 20 +- examples/block-navigation.rs | 2 +- src/detection.rs | 2 +- src/handler/domworld.rs | 19 +- src/handler/frame.rs | 23 +- src/handler/mod.rs | 2 +- src/handler/network.rs | 2 +- src/page.rs | 5 + 15 files changed, 62709 insertions(+), 45729 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05b5c3d3..18415392 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["chrome", "chromedriver", "puppeteer", "automation"] categories = ["web-programming", "api-bindings", "development-tools::testing"] [dependencies] -async-tungstenite = "0.25" +async-tungstenite = "0.27.0" serde = { version = "1", features = ["derive"] } async-std = { version = "1.5", features = [ "attributes", @@ -24,7 +24,7 @@ chromiumoxide_types = { path = "chromiumoxide_types", version = "0.6" } chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.6" } chromiumoxide_fetcher = { path = "chromiumoxide_fetcher", version = "0.6", default-features = false, optional = true } serde_json = "1" -which = "4" +which = "6" thiserror = "1" url = "2" base64 = "0.22" @@ -61,6 +61,7 @@ async-std-runtime = ["async-std", "async-tungstenite/async-std-runtime"] tokio-runtime = ["tokio", "async-tungstenite/tokio-runtime"] fetcher = [] bytes = ["dep:bytes"] +serde0 = [] # Temporary features until cargo weak dependencies bug is fixed # See https://github.com/rust-lang/cargo/issues/10801 diff --git a/chromiumoxide_cdp/Cargo.toml b/chromiumoxide_cdp/Cargo.toml index 6db88caa..1079e125 100644 --- a/chromiumoxide_cdp/Cargo.toml +++ b/chromiumoxide_cdp/Cargo.toml @@ -11,10 +11,13 @@ repository = "https://github.com/mattsse/chromiumoxide" readme = "../README.md" include = ["src/**/*", "*.pdl", "LICENSE-*"] +[features] +serde0 = [] + [dev-dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.6" } -ureq = "2.6.2" -tempfile = "3.2.0" +ureq = "2.10.0" +tempfile = "3.10.1" [dependencies] chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.6" } diff --git a/chromiumoxide_cdp/browser_protocol.pdl b/chromiumoxide_cdp/browser_protocol.pdl index 01a22c24..77608eef 100644 --- a/chromiumoxide_cdp/browser_protocol.pdl +++ b/chromiumoxide_cdp/browser_protocol.pdl @@ -1,4 +1,4 @@ -# Copyright 2017 The Chromium Authors. All rights reserved. +# Copyright 2017 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # @@ -72,7 +72,7 @@ experimental domain Accessibility optional AXValue attributeValue # Whether this source is superseded by a higher priority source. optional boolean superseded - # The native markup source for this value, e.g. a