https://github.com/devlooped/chromium
Run a portable Chromium using dotnet 6+ and nuget.
https://github.com/devlooped/chromium
chromium playwright
Last synced: 3 months ago
JSON representation
Run a portable Chromium using dotnet 6+ and nuget.
- Host: GitHub
- URL: https://github.com/devlooped/chromium
- Owner: devlooped
- License: mit
- Created: 2022-06-02T00:40:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T04:09:45.000Z (3 months ago)
- Last Synced: 2025-04-01T04:55:01.005Z (3 months ago)
- Topics: chromium, playwright
- Language: C#
- Homepage:
- Size: 146 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license.txt
Awesome Lists containing this project
README
 dotnet-chromium
============[](https://www.nuget.org/packages/dotnet-chromium)
[](https://www.nuget.org/packages/dotnet-chromium)
[](https://github.com/devlooped/chromium/blob/main/license.txt)
[](https://github.com/devlooped/chromium/actions)Chromium for .NET 6+.
This project allows running a portable embedded version of Chromium from
either a .NET CLI tool or a regular .NET application without having to install
it.This can help automate a browser as part of your regular app
normal behavior, such as using [Microsoft.Playwright](https://playwright.dev/dotnet/).## Usage
The project provides two main ways to consume it:
- As a dotnet global tool
- As a regular nuget package library reference.### dotnet global tool
Install with:
```
dotnet tool install -g dotnet-chromium
```Run with:
```
chromium [url] [switches]
```The `url` is optional, and causes the browser to navigate immediately
to that URL on open.The `switches` are optional, and are passed directly to Chromium. For
example, you'd pass `-headless` to run the browser headless. See the
[list of chromium switches](https://peter.sh/experiments/chromium-command-line-switches/)
for more information.### nuget package library reference
[](https://www.nuget.org/packages/chromium)
[](https://www.nuget.org/packages/chromium)```
Install-Package chromium
``````csharp
if (Chromium.Path != null)
Console.WriteLine($"Found Chromium for current platform at {Chromium.Path}");
else
Console.WriteLine($"Current runtime {System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier} is not supported.");
```This will provide the runtime lookup of the native binaries, but will *not* provide the binaries themselves.
In other words, the `chromium` package is not a **metapackage**. Since NuGet does not provide a built-in
mechanism to conditionally reference specific packages depending on the current runtime platform or library
target's `RuntimeIdentifier(s)`, a metapackage is not practical since it would cause a restore of *all*
platforms, which only bloats download and install size unnecessarily. If you know what platforms your app
will run on, you can reference the relevant ones manually by adding package references to
`chromium.[RID]` as necessary:[](https://www.nuget.org/packages/chromium.linux-x64)
[](https://www.nuget.org/packages/chromium.win-x64)
[](https://www.nuget.org/packages/chromium.win-x86)## Releasing
We run a [scheduled workflow](https://github.com/devlooped/chromium/actions/workflows/scheduled.yml) every other week
which creates a new release versioned as `v[YYYY].[M].[D]`, which bundles the snapshots of that day.It's also possible to create a new release on demand, versioned as `v[YYYY].[M].[D]` and the bundled binaries will be the
snapshots of the day the release build runs.We fetch binaries from:
* Win-x64: https://download-chromium.appspot.com/dl/Win_x64?type=snapshots
* Win-x86: https://download-chromium.appspot.com/dl/Win?type=snapshots
* Linux-x64: https://download-chromium.appspot.com/dl/Linux_x64?type=snapshots# Sponsors
[](https://github.com/clarius)
[](https://github.com/MFB-Technologies-Inc)
[](https://github.com/torutek-gh)
[](https://github.com/drivenet)
[](https://github.com/Keflon)
[](https://github.com/tbolon)
[](https://github.com/kfrancis)
[](https://github.com/twenzel)
[](https://github.com/unoplatform)
[](https://github.com/dansiegel)
[](https://github.com/rbnswartz)
[](https://github.com/jfoshee)
[](https://github.com/Mrxx99)
[](https://github.com/eajhnsn1)
[](https://github.com/IxTechnologies)
[](https://github.com/davidjenni)
[](https://github.com/Jonathan-Hickey)
[](https://github.com/akunzai)
[](https://github.com/jakobt)
[](https://github.com/tinohager)
[](https://github.com/KenBonny)
[](https://github.com/SimonCropp)
[](https://github.com/agileworks-eu)
[](https://github.com/sorahex)
[](https://github.com/arsdragonfly)
[](https://github.com/vezel-dev)
[](https://github.com/ChilliCream)
[](https://github.com/4OTC)
[](https://github.com/v-limo)
[](https://github.com/jordansjones)
[](https://github.com/DominicSchell)
[](https://github.com/jkingry)[](https://github.com/sponsors/devlooped)
[Learn more about GitHub Sponsors](https://github.com/sponsors)