Skip to content

Commit

Permalink
Merge pull request #86 from litmus/chromium/binary/switch
Browse files Browse the repository at this point in the history
Switch Lambda Binary NodeJs project to @sparticuz/chromium
  • Loading branch information
brianfeucht authored Oct 25, 2022
2 parents aeb97c6 + 58f8005 commit 53c9c62
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Packages everything you need to run [PuppeteerSharp](https://github.com/kblok/pu
[![Nuget status](https://img.shields.io/nuget/v/HeadlessChromium.Puppeteer.Lambda.Dotnet.svg?style=flat)](https://www.nuget.org/packages/HeadlessChromium.Puppeteer.Lambda.Dotnet)

# Description
The chromium binary for this project has been extracted from the NPM project [chrome-aws-lambda](https://github.com/alixaxel/chrome-aws-lambda). It is automatically extracted to `/tmp/chromium` at runtime.
The chromium binary for this project has been extracted from the NPM project [Sparticuz/chromium](https://github.com/Sparticuz/chromium). It is automatically extracted to `/tmp/chromium` at runtime.

# Usage
Screenshot a URL as a byte[]. This project requires lambda to be configured as `netcoreapp3.1`
Expand Down
4 changes: 2 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ string GetNpmTarballUrl()
{
var json = System.IO.File.ReadAllText("package.json");
var package = JsonConvert.DeserializeObject<dynamic>(json);
var version = package.dependencies["chrome-aws-lambda"];
return $"https://registry.npmjs.org/chrome-aws-lambda/-/chrome-aws-lambda-{version}.tgz";
var version = package.dependencies["@sparticuz/chromium"];
return $"https://registry.npmjs.org/@sparticuz/chromium/-/chromium-{version}.tgz";
}

RunTarget(target);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "HeadlessChromium.Puppeteer.Lambda.Dotnet",
"version": "0.0.1-dev",
"dependencies": {
"chrome-aws-lambda": "10.0.0"
"@sparticuz/chromium": "107.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public string ExtractChromium()
if (!File.Exists(ChromiumPath))
{
ExtractDependencies("aws.tar.br", "/tmp");
ExtractDependencies("swiftshader.tar.br", "/tmp/swiftshader");
ExtractDependencies("swiftshader.tar.br", "/tmp");

var compressedFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "chromium.br");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Company>Litmus</Company>
<PackageLicenseUrl>https://github.com/litmus/HeadlessChromium.Puppeteer.Lambda.Dotnet/blob/master/LICENSE</PackageLicenseUrl>
<Copyright>2019 Litmus</Copyright>
<Copyright>2022 Litmus</Copyright>
<PackageProjectUrl>https://github.com/litmus/HeadlessChromium.Puppeteer.Lambda.Dotnet</PackageProjectUrl>
<RepositoryUrl>https://github.com/litmus/HeadlessChromium.Puppeteer.Lambda.Dotnet</RepositoryUrl>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version Condition="'$(VersionSuffix)' != ''">1.0.1.$(VersionSuffix)</Version>
<Version Condition="'$(VersionSuffix)' != ''">1.1.0.$(VersionSuffix)</Version>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down

0 comments on commit 53c9c62

Please sign in to comment.