133.0.0-alpha.4 • Published 6 months ago
@oro-dxeco/playwright-aws-lambda v133.0.0-alpha.4
playwright-aws-lambda
Support for Playwright running on AWS Lambda and Google Cloud Functions.
NOTE: Currently only Chromium is supported.
Install
npm install playwright-core playwright-aws-lambda --saveUsage
This package works with the nodejs10.x, nodejs12.x, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x and nodejs22.x AWS Lambda runtimes
out of the box.
const playwright = require('playwright-aws-lambda');
exports.handler = async (event, context) => {
let browser = null;
try {
browser = await playwright.launchChromium();
const context = await browser.newContext();
const page = await context.newPage();
await page.goto(event.url || 'https://example.com');
console.log('Page title: ', await page.title());
} catch (error) {
throw error;
} finally {
if (browser) {
await browser.close();
}
}
};API
| Method / Property | Returns | Description |
|---|---|---|
launchChromium | {!Promise<playwright.ChromiumBrowser>} | Launches the Chromium browser. |
loadFont(url) | {Promise<void>} | Downloads and activates a custom font |
Loading additional fonts
If you need custom font support by e.g. emojicons in your browser, you have to
load it by using the loadFont(url: string) function before you launch the
browser.
await loadFont(
'https://raw.githack.com/googlei18n/noto-emoji/master/fonts/NotoColorEmoji.ttf'
);Thanks / Credits
This project is based on the work of chrome-aws-lambda.
133.0.0-alpha.3
7 months ago
133.0.0-alpha.2
7 months ago
133.0.0-alpha.1
7 months ago
133.0.0-alpha.0
7 months ago
133.0.0-alpha.4
6 months ago
119.0.5
7 months ago
119.0.0
2 years ago
119.0.1
2 years ago
119.0.2
2 years ago
119.0.3
2 years ago
0.11.0
2 years ago
119.0.4
2 years ago
0.11.1
2 years ago
0.11.2
2 years ago
0.11.3
2 years ago
0.9.2
3 years ago
0.9.1
3 years ago
0.9.0
3 years ago