mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
0a9377e0a9
- setup .npmignore; - index.js selecting a browser; - minor package.json tweaks; - example script which works against npm pack'ed module.
18 lines
575 B
JavaScript
18 lines
575 B
JavaScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
(async () => {
|
|
const browserName = process.argv[2];
|
|
const playwright = require('playwright')(browserName);
|
|
|
|
console.log('downloading ' + browserName + '...');
|
|
const revisionInfo = await playwright.downloadBrowser();
|
|
console.log('downloaded to ' + revisionInfo.folderPath);
|
|
|
|
console.log('checking user agent...');
|
|
const browser = await playwright.launch();
|
|
const page = await browser.newPage();
|
|
console.log(await page.evaluate('navigator.userAgent'));
|
|
await browser.close();
|
|
})()
|