Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal versions #79

Merged
merged 3 commits into from Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 19 additions & 19 deletions Cargo.toml
Expand Up @@ -12,31 +12,31 @@ keywords = ["chrome", "chromedriver", "puppeteer", "automation"]
categories = ["web-programming", "api-bindings", "development-tools::testing"]

[dependencies]
async-tungstenite = "0.16.0"
serde = { version = "1.0.130", features = ["derive"] }
async-std = { version = "1.10.0", features = ["attributes", "unstable"], optional = true }
futures = "0.3.18"
async-tungstenite = "0.16"
serde = { version = "1", features = ["derive"] }
async-std = { version = "1.5", features = ["attributes", "unstable"], optional = true }
futures = "0.3"
chromiumoxide_types = { path = "chromiumoxide_types", version = "0.3.1" }
chromiumoxide_cdp = { path = "chromiumoxide_cdp", version = "0.3.1" }
serde_json = "1.0.72"
which = "4.2.2"
thiserror = "1.0.30"
url = "2.2.2"
log = "0.4.14"
base64 = "0.13.0"
fnv = "1.0.7"
futures-timer = "3.0.2"
cfg-if = "1.0.0"
tokio = { version = "1.14.0", features = ["rt", "rt-multi-thread", "time", "fs", "macros"], optional = true }
serde_json = "1"
which = "4"
thiserror = "1"
url = "2"
log = "0.4"
base64 = "0.13"
fnv = "1"
futures-timer = "3"
cfg-if = "1"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "fs", "macros"], optional = true }

[target.'cfg(windows)'.dependencies]
winreg = "0.10.1"
winreg = "0.10"

[dev-dependencies]
quote = "1.0.10"
proc-macro2 = "1.0.32"
chrono = "0.4.19"
pretty_env_logger = "0.4.0"
quote = "1"
proc-macro2 = "1"
chrono = "0.4.1"
pretty_env_logger = "0.4"

[features]
default = ["async-std-runtime"]
Expand Down
2 changes: 1 addition & 1 deletion src/element.rs
Expand Up @@ -151,7 +151,7 @@ impl Element {
.quads
.iter()
.filter(|q| q.inner().len() == 8)
.map(|q| ElementQuad::from_quad(q))
.map(ElementQuad::from_quad)
.filter(|q| q.quad_area() > 1.)
.map(|q| q.quad_center())
.next()
Expand Down
5 changes: 0 additions & 5 deletions src/handler/domworld.rs
@@ -1,26 +1,21 @@
use chromiumoxide_cdp::cdp::js_protocol::runtime::ExecutionContextId;
use std::collections::HashSet;

#[derive(Debug, Clone, Default)]
pub struct DOMWorld {
/// Bindings that have been registered in the current context
ctx_bindings: HashSet<String>,
execution_ctx: Option<ExecutionContextId>,
detached: bool,
}

impl DOMWorld {
pub fn main_world() -> Self {
Self {
ctx_bindings: Default::default(),
execution_ctx: None,
detached: false,
}
}

pub fn secondary_world() -> Self {
Self {
ctx_bindings: Default::default(),
execution_ctx: None,
detached: false,
}
Expand Down
1 change: 0 additions & 1 deletion src/handler/mod.rs
Expand Up @@ -367,7 +367,6 @@ impl Handler {
fn on_attached_to_target(&mut self, event: EventAttachedToTarget) {
let session = Session::new(
event.session_id.clone(),
event.target_info.r#type,
event.target_info.target_id,
);
if let Some(target) = self.targets.get_mut(session.target_id()) {
Expand Down
6 changes: 1 addition & 5 deletions src/handler/session.rs
Expand Up @@ -5,17 +5,13 @@ use chromiumoxide_cdp::cdp::browser_protocol::target::{SessionId, TargetId};
pub struct Session {
/// Identifier for this session.
id: SessionId,
/// The type of the target this session is attached to.
/// Used to determine whether this is a page or worker session.
target_type: String,
/// The identifier of the target this session is attached to.
target_id: TargetId,
}
impl Session {
pub fn new(id: SessionId, target_type: String, target_id: TargetId) -> Self {
pub fn new(id: SessionId, target_id: TargetId) -> Self {
Self {
id,
target_type,
target_id,
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/handler/target.rs
Expand Up @@ -67,8 +67,6 @@ pub struct Target {
r#type: TargetType,
/// Configs for this target
config: TargetConfig,
/// Whether this target was marked as closed
is_closed: bool,
/// The context this target is running in
browser_context: BrowserContext,
/// The frame manager that maintains the state of all frames and handles
Expand Down Expand Up @@ -104,7 +102,6 @@ impl Target {
info,
r#type: ty,
config,
is_closed: false,
frame_manager: FrameManager::new(request_timeout),
network_manager,
emulation_manager: EmulationManager::new(request_timeout),
Expand Down