Fullscreen windows at startup
We don't want the browser chrome showing on heads-up displays.dev/ci
parent
09342acb01
commit
311e73e097
|
@ -117,4 +117,6 @@ pub enum Command {
|
||||||
NewWindow,
|
NewWindow,
|
||||||
#[serde(rename = "WebDriver:SwitchToWindow")]
|
#[serde(rename = "WebDriver:SwitchToWindow")]
|
||||||
SwitchToWindow(SwitchToWindowParams),
|
SwitchToWindow(SwitchToWindowParams),
|
||||||
|
#[serde(rename = "WebDriver:FullscreenWindow")]
|
||||||
|
FullscreenWindow,
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,13 @@ impl Marionette {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn fullscreen(&mut self) -> Result<(), CommandError> {
|
||||||
|
let res: serde_json::Value =
|
||||||
|
self.conn.send_message(Command::FullscreenWindow).await?.unwrap();
|
||||||
|
debug!("Received message: {:?}", res);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn get_title(&mut self) -> Result<String, CommandError> {
|
pub async fn get_title(&mut self) -> Result<String, CommandError> {
|
||||||
let res: GetTitleResponse =
|
let res: GetTitleResponse =
|
||||||
self.conn.send_message(Command::GetTitle).await?.unwrap();
|
self.conn.send_message(Command::GetTitle).await?.unwrap();
|
||||||
|
|
|
@ -143,7 +143,10 @@ impl Session {
|
||||||
if window.is_none() {
|
if window.is_none() {
|
||||||
window = Some(self.marionette.new_window().await?);
|
window = Some(self.marionette.new_window().await?);
|
||||||
}
|
}
|
||||||
windowmap.insert(monitor.name, window.take().unwrap());
|
let w = window.take().unwrap();
|
||||||
|
self.marionette.switch_to_window(w.clone(), false).await?;
|
||||||
|
self.marionette.fullscreen().await?;
|
||||||
|
windowmap.insert(monitor.name, w);
|
||||||
}
|
}
|
||||||
trace!("Built window map: {:?}", windowmap);
|
trace!("Built window map: {:?}", windowmap);
|
||||||
Ok(windowmap)
|
Ok(windowmap)
|
||||||
|
|
Loading…
Reference in New Issue