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

feat(browser): add support for the new headless mode in BrowserConfig #208

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

starrify
Copy link
Contributor

resolves #183 (kind of)

src/browser.rs Outdated
Comment on lines 562 to 570
#[derive(Debug, Clone)]
enum HeadlessMode {
False,
True,
New,
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we document these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mattsse sure and it's now added. Sorry for not having included any description from the start.

@starrify starrify force-pushed the browser-config-add-new-headless-mode branch from f95b254 to dda6fff Compare February 15, 2024 23:10
Copy link
Owner

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last nits

/// The "headful" mode.
False,
/// The old headless mode (default).
True,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be #[default]

src/browser.rs Outdated
Comment on lines 698 to 706
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
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want a new function that provides the HeadlessMode as argument

src/browser.rs Outdated
@@ -559,11 +559,21 @@ async fn ws_url_from_output(
}
}

#[derive(Debug, Clone)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]

@starrify
Copy link
Contributor Author

Hi @mattsse , thanks a lot for the recommendations! I have the request changes applied accordingly.

@mattsse mattsse merged commit bd62ee3 into mattsse:main Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use new headless mode.
2 participants