Added complete example
This commit is contained in:
parent
503db13867
commit
f337cdad26
11
README.md
11
README.md
|
|
@ -50,6 +50,17 @@ const test = require("node:test");
|
|||
const puppeteer = require("puppeteer-core");
|
||||
const chromium = require("@sparticuz/chromium");
|
||||
|
||||
// Optional: If you'd like to use the legacy headless mode. "new" is the default.
|
||||
chromium.setHeadlessMode = true;
|
||||
|
||||
// Optional: If you'd like to disable webgl, true is the default.
|
||||
chromium.setGraphicsMode = false;
|
||||
|
||||
// Optional: Load any fonts you need. Open Sans is included by default in AWS Lambda instances
|
||||
await chromium.font(
|
||||
"https://raw.githack.com/googlei18n/noto-emoji/master/fonts/NotoColorEmoji.ttf"
|
||||
);
|
||||
|
||||
test("Check the page title of example.com", async (t) => {
|
||||
const browser = await puppeteer.launch({
|
||||
args: chromium.args,
|
||||
|
|
|
|||
Loading…
Reference in New Issue