chromiumoxide
chromiumoxide copied to clipboard
html page does not expand to window extents
Below is the code I am using to test oxide.
let baseurl = "http://www.google.com".to_owned();
let (browser, mut handler) =
Browser::launch(BrowserConfig::builder().with_head().build()?).await?;
let handle = tokio::task::spawn(async move {
loop {
let _ = handler.next().await.unwrap();
}
});
let _p = browser.new_page(baseurl.clone()).await?;
handle.await?;
Ok(())
The page comes up and the viewport/webpage is not expanding to the window extents. Is there something that would cause this resize issue?
I also would like to know how to do this properly. My current solution is to set both window_size
and viewport
.
BrowserConfig::builder()
.window_size(1600, 1000)
.viewport(Viewport {
width: 1600,
height: 1000,
..Viewport::default()
})
.with_head()
.build()?
I've tried setting a height and width and creating a viewport too. Sometimes the viewport will size correctly.
Browser::launch(BrowserConfig::builder()
.viewport(Viewport { width: 1190, height: 800, device_scale_factor: None, emulating_mobile: false, is_landscape: true, has_touch: false })
.window_size(1190,800)
I don't think setting the window_size and viewport are the fix. I couldn't come up with any other ideas on triangulating what the ultimate cause. Chrome does not exhibit the same behavior when run normally.
It's sizing this morning on my machine properly. I was going to close the ticket but I still experience it intermittently. If someone else is experiencing the sizing issues too, that helps.
This seems to be a duplicate of https://github.com/mattsse/chromiumoxide/issues/100
This is not nodejs or puppeteer, I don't understand the resolution. I stopped using chromiumoxide because I couldn't get this figured out.
I got it working with this code
let (mut browser, mut handler) =
Browser::launch(
BrowserConfig::builder()
.window_size(1920, 1080)
.viewport(None)
.with_head()
.build()?
).await?;
I don't get why this is still an open issue