DEV Community

Chris
Chris

Posted on

Programatically Starting a Chromium page in Full Screen - .NET

Using the "System.Diagnostics" namespace in .NET, you can Automate launching a page in full-screen using a Chromium browser.

Here's an example written in PowerShell.

$_processInfo = New-Object System.Diagnostics.ProcessStartInfo 

# use this if you want maximized instead of full-screen for any application. 
$_processInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Maximized 

# Provide the path to the browsers executable
$_processInfo.FileName = "C:\Program Files\Google\Chrome\Application\chrome.exe"

# Launch in full screen using the flag '--start-fullscreen'
$_processInfo.Arguments = "--start-fulscreen", "-app $($URL)"

# add the process info and start
$_process = New-Object System.Diagnostics.Process
$_process.StartInfo = $_processInfo 
$_process.Start()
Enter fullscreen mode Exit fullscreen mode

Top comments (0)