From f337cdad26b91998978cf934f1d1436901ddb870 Mon Sep 17 00:00:00 2001 From: Sparticuz Date: Mon, 27 Mar 2023 12:29:52 -0400 Subject: [PATCH] Added complete example --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 316ffc5..6668efe 100644 --- a/README.md +++ b/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,