playwright
Advanced tools
Comparing version 0.11.1-next.1584577781703 to 0.11.1-next.1584644386005
16
index.js
@@ -16,9 +16,19 @@ /** | ||
*/ | ||
const path = require('path'); | ||
const {Playwright} = require('playwright-core/lib/server/playwright.js'); | ||
module.exports = new Playwright({ | ||
downloadPath: __dirname, | ||
const playwright = new Playwright({ | ||
browsers: ['webkit', 'chromium', 'firefox'], | ||
respectEnvironmentVariables: true, | ||
}); | ||
module.exports = playwright; | ||
try { | ||
const downloadedBrowsers = require(path.join(__dirname, '.downloaded-browsers.json')); | ||
playwright.chromium._executablePath = downloadedBrowsers.crExecutablePath; | ||
playwright.firefox._executablePath = downloadedBrowsers.ffExecutablePath; | ||
playwright.webkit._executablePath = downloadedBrowsers.wkExecutablePath; | ||
} catch (e) { | ||
throw new Error('ERROR: Playwright did not download browsers'); | ||
} | ||
@@ -16,8 +16,11 @@ /** | ||
*/ | ||
const {downloadBrowser} = require('playwright-core/download-browser'); | ||
const playwright = require('.'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const {downloadBrowserWithProgressBar} = require('playwright-core/download-browser'); | ||
(async function() { | ||
await downloadBrowser(playwright.chromium); | ||
await downloadBrowser(playwright.firefox); | ||
await downloadBrowser(playwright.webkit); | ||
const crExecutablePath = await downloadBrowserWithProgressBar(path.join(__dirname, '.local-browsers', 'chromium'), 'chromium'); | ||
const ffExecutablePath = await downloadBrowserWithProgressBar(path.join(__dirname, '.local-browsers', 'firefox'), 'firefox'); | ||
const wkExecutablePath = await downloadBrowserWithProgressBar(path.join(__dirname, '.local-browsers', 'webkit'), 'webkit'); | ||
await fs.promises.writeFile(path.join(__dirname, '.downloaded-browsers.json'), JSON.stringify({crExecutablePath, ffExecutablePath, wkExecutablePath, })); | ||
})(); |
{ | ||
"name": "playwright", | ||
"version": "0.11.1-next.1584577781703", | ||
"version": "0.11.1-next.1584644386005", | ||
"description": "A high-level API to automate web browsers", | ||
@@ -15,4 +15,4 @@ "repository": "github:Microsoft/playwright", | ||
"dependencies": { | ||
"playwright-core": "=0.11.1-next.1584577781703" | ||
"playwright-core": "=0.11.1-next.1584644386005" | ||
} | ||
} |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
14965
54
3