diff --git a/Cargo.toml b/Cargo.toml index 589e1134..b46613ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" [dependencies] anyhow = "1" -base64 = "0.13" +base64 = "0.21" derive_builder = "0.12" directories = { version = "4.0", optional = true } log = "0.4" diff --git a/src/browser/tab/mod.rs b/src/browser/tab/mod.rs index 7a29179e..bcc4322f 100644 --- a/src/browser/tab/mod.rs +++ b/src/browser/tab/mod.rs @@ -26,6 +26,8 @@ use crate::protocol::cdp::{ use Runtime::AddBinding; +use base64::Engine; + use Input::DispatchKeyEvent; use Page::{AddScriptToEvaluateOnNewDocument, Navigate, SetInterceptFileChooserDialog}; @@ -1049,7 +1051,9 @@ impl Tab { capture_beyond_viewport: None, })? .data; - base64::decode(data).map_err(Into::into) + base64::prelude::BASE64_STANDARD + .decode(data) + .map_err(Into::into) } pub fn print_to_pdf(&self, options: Option) -> Result> { @@ -1076,7 +1080,9 @@ impl Tab { transfer_mode, })? .data; - base64::decode(data).map_err(Into::into) + base64::prelude::BASE64_STANDARD + .decode(data) + .map_err(Into::into) } else { let data = self .call_method(Page::PrintToPDF { @@ -1084,7 +1090,9 @@ impl Tab { })? .data; - base64::decode(data).map_err(Into::into) + base64::prelude::BASE64_STANDARD + .decode(data) + .map_err(Into::into) } }