Forem

Darío Kondratiuk
Darío Kondratiuk

Posted on • Originally published at hardkoded.com on

1

PlaywrightSharp v0.10 for Firefox is here!

firefox

Firefox joined to the PlaywrightSharp family!

What can I do with PlaywrightSharp.Firefox?

You can do lots of things.

a lot

Seriously!

seriously

You should be able to do almost everything you would do with his older brother PuppeteerSharp or his younger brother PlaywrightSharp.Chromium.

This is how you can take a screenshot in PlaywrightSharp NOW!

var options = new LaunchOptions
{
    Headless = true
};

Console.WriteLine("Downloading Firefox");
var firefox = new FirefoxBrowserType();

await firefox.CreateBrowserFetcher().DownloadAsync();

Console.WriteLine("Navigating google");
await using var browser = await firefox.LaunchAsync(options);
var page = await browser.DefaultContext.NewPageAsync();
await page.GoToAsync("http://www.microsoft.com");

Console.WriteLine("Taking Screenshot");
File.WriteAllBytes(Path.Combine(Directory.GetCurrentDirectory(), "microsoft.png"), await page.ScreenshotAsync());

Console.WriteLine("Export completed");

Is there anything I can't do?

There are only two features not implemented on PlaywrightSharp.Firefox: PDF generator and Tracing.

Can I use this package in Production?

As I mentioned when we launched Playwrightsharp.Chromium, If you start using PlaywrightSharp now, the API is going to change, guaranteed, but you will jump into a project that will have way more support and new features.

PuppeteerSharp doesn't support Firefox yet. So I believe PlaywrightSharp.Firefox, even in its 0.10 version, is the best library to automate Firefox in .NET.

Final words

Now that we shipped our first version, I'm looking forward to getting more feedback. The issues tab in GitHub is open for all of you to share your ideas and thoughts.

Don't forget to follow me on Twitter @hardkoded to get more updates.

Don't stop coding!

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay