Skip to content

Commit

Permalink
Merge pull request #224 from Sparticuz/chromium/121
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparticuz authored Jan 29, 2024
2 parents 30743fd + 424f3e9 commit 857ae08
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test:
npm install --fund=false --package-lock=false
npm run build
mkdir -p nodejs
npm install --prefix nodejs/ [email protected] [email protected].3 --bin-links=false --fund=false --omit=optional --omit=dev --package-lock=false --save=false
npm install --prefix nodejs/ [email protected] [email protected].5 --bin-links=false --fund=false --omit=optional --omit=dev --package-lock=false --save=false
npm pack
mkdir -p nodejs/node_modules/@sparticuz/chromium/
tar --directory nodejs/node_modules/@sparticuz/chromium/ --extract --file sparticuz-chromium-*.tgz --strip-components=1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ This method should be invoked _before_ launching Chromium.

Alternatively, it's also possible to provision fonts via AWS Lambda Layers.

Simply create a directory named `fonts` and place any font faces you want there:
Simply create a directory named `.fonts` or `fonts` and place any font faces you want there:

```
fonts
.fonts
├── NotoColorEmoji.ttf
└── Roboto.ttf
```
Expand Down
6 changes: 3 additions & 3 deletions _/amazon/events/example.com.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"url": "https://example.com",
"expected": {
"title": "Example Domain",
"screenshot": "cf91d541795c36da2e8733ed389e9a7951d5fe7f"
"screenshot": "3f1863ac017614ce6a389cf719da28b774595abe"
}
},
{
"url": "https://example.com",
"expected": {
"title": "Example Domain",
"screenshot": "cf91d541795c36da2e8733ed389e9a7951d5fe7f"
"screenshot": "3f1863ac017614ce6a389cf719da28b774595abe"
}
},
{
"url": "https://get.webgl.org",
"expected": {
"remove": "logo-container",
"screenshot": "2ca647063ec0be49a6191a7716c6a125e0a5b31b"
"screenshot": "bf35ed6405670c506b549906f6b467421bc8b430"
}
}
]
11 changes: 9 additions & 2 deletions _/amazon/handlers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports.handler = async (event, context) => {
ignoreHTTPSErrors: true,
});

console.log("Chromium verion", await browser.version());
console.log("Chromium version", await browser.version());

const contexts = [browser.defaultBrowserContext()];

Expand Down Expand Up @@ -46,7 +46,14 @@ exports.handler = async (event, context) => {
}, job.expected.remove);
}
const screenshot = await page.screenshot();
// console.log(screenshot.toString('base64'), createHash('sha1').update(screenshot.toString('base64')).digest('hex'));
/*
console.log(
`data:image/png;base64,${screenshot.toString("base64")}`,
createHash("sha1")
.update(screenshot.toString("base64"))
.digest("hex")
);
*/
ok(
createHash("sha1")
.update(screenshot.toString("base64"))
Expand Down
2 changes: 1 addition & 1 deletion _/ansible/inventory.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ instance_size=c6i.12xlarge
ansible_connection=ssh
ansible_python_interpreter=auto_silent
ansible_ssh_private_key_file=ansible.pem
chromium_revision=1204232
chromium_revision=1233107
Binary file modified bin/chromium.br
Binary file not shown.
Binary file modified bin/fonts.tar.br
Binary file not shown.
Binary file modified bin/swiftshader.tar.br
Binary file not shown.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"test": "make clean && make && make pretest && make test"
},
"dependencies": {
"follow-redirects": "^1.15.3",
"follow-redirects": "^1.15.5",
"tar-fs": "^3.0.4"
},
"devDependencies": {
"@tsconfig/node16": "^16.1.1",
"@tsconfig/strictest": "^2.0.2",
"@types/follow-redirects": "^1.14.4",
"@types/node": "^18.19.3",
"@types/node": "^20.11.10",
"@types/tar-fs": "^2.0.4",
"clean-modules": "^3.0.4",
"typescript": "^5.3.3"
Expand Down

0 comments on commit 857ae08

Please sign in to comment.