Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
gatsby-plugin-playwright
Advanced tools
Uses Playwright to generate screenshots in Chromium, Firefox and WebKit.
Uses Playwright to generate screenshots in Chromium, Firefox and WebKit.
NOTE: This plugin only generates output with gatsby build
yarn add -D gatsby-plugin-playwright
plugins: ['gatsby-plugin-playwright']
The options are as follows:
port
(number) The port number for the web server to listen to. Defaults to 9000
.screenshotsDir
(string) The screenshots directory path. Defaults to ./screenshots
.browsers
(array of strings) An array of browsers for playwright to screenshot. Defaults to ['chromium', 'firefox', 'webkit']
context
(BrowserContext) Defaults to {}
query
(GraphQL Query) The query for the data you need to generate the screenshots. If you change the query you also need to change the serialize function to properly format the data.serialize
(function) Takes the output of the data query and has to return an array with strings that reflects the page path.// gatsby-config.js for desktop testing
plugins: [
{
resolve: 'gatsby-plugin-playwright',
options: {
port: 9000,
screenshotsDir: './screenshots',
browsers: ['chromium', 'firefox', 'webkit'],
context: {},
query: `
{
allSitePage {
nodes {
path
}
}
}
`,
serialize: function ({ allSitePage }) {
return allSitePage.nodes.map((page) => page.path);
}
}
},
]
Define a context to test for different widths, heights, geolocation and permissions. You can read more about the browser context on the official Playwright documentation
// gatsby-config.js for testing specific contexts
plugins: [
{
resolve: `gatsby-plugin-playwright`,
options: {
browsers: ['webkit'],
// This example is an iPhone 11
context: {
'userAgent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1',
'viewport': {
'width': 414,
'height': 896
},
'deviceScaleFactor': 2,
'isMobile': true,
'hasTouch': true
},
}
},
]
FAQs
Uses Playwright to generate screenshots in Chromium, Firefox and WebKit.
The npm package gatsby-plugin-playwright receives a total of 0 weekly downloads. As such, gatsby-plugin-playwright popularity was classified as not popular.
We found that gatsby-plugin-playwright demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.