Go to file
dependabot[bot] 3e8363eb80
chore(deps): bump ossf/scorecard-action from 2.0.3 to 2.0.6 (#9170)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action)
from 2.0.3 to 2.0.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ossf/scorecard-action/releases">ossf/scorecard-action's
releases</a>.</em></p>
<blockquote>
<h2>v2.0.6</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix - Broken dockerfile by <a
href="https://github.com/naveensrinivasan"><code>@​naveensrinivasan</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/979">ossf/scorecard-action#979</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/ossf/scorecard-action/compare/v2.0.5...v2.0.6">https://github.com/ossf/scorecard-action/compare/v2.0.5...v2.0.6</a></p>
<h2>v2.0.5</h2>
<h2>What's Changed</h2>
<ul>
<li>Remove trailing space from example by <a
href="https://github.com/jamacku"><code>@​jamacku</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/955">ossf/scorecard-action#955</a></li>
<li>🌱 Bump actions/cache from 3.0.8 to 3.0.10 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/956">ossf/scorecard-action#956</a></li>
<li>🌱 Bump github/codeql-action from 2.1.25 to 2.1.26 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/957">ossf/scorecard-action#957</a></li>
<li>🌱 Bump step-security/harden-runner from 1.4.5 to 1.5.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/958">ossf/scorecard-action#958</a></li>
<li>🌱 Bump debian from <code>5cf1d98</code> to
<code>b46fc4e</code> by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/959">ossf/scorecard-action#959</a></li>
<li>🌱 Bump github.com/sigstore/cosign from 1.12.1 to 1.13.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/962">ossf/scorecard-action#962</a></li>
<li>🌱 Upgrade to go 1.19 by <a
href="https://github.com/naveensrinivasan"><code>@​naveensrinivasan</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/961">ossf/scorecard-action#961</a></li>
<li>🌱 Bump github.com/spf13/cobra from 1.5.0 to 1.6.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/967">ossf/scorecard-action#967</a></li>
<li>🌱 Bump golang from <code>c2a98a5</code> to
<code>b850621</code> by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/966">ossf/scorecard-action#966</a></li>
<li>🌱 Bump golang from <code>b850621</code> to
<code>25de7b6</code> by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/968">ossf/scorecard-action#968</a></li>
<li>New release for Scorecard v4.8.0 by <a
href="https://github.com/naveensrinivasan"><code>@​naveensrinivasan</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/969">ossf/scorecard-action#969</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/jamacku"><code>@​jamacku</code></a> made
their first contribution in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/955">ossf/scorecard-action#955</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/ossf/scorecard-action/compare/v2.0.4...v2.0.5">https://github.com/ossf/scorecard-action/compare/v2.0.4...v2.0.5</a></p>
<h2>v2.0.4</h2>
<p>Fixes <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/856">#856</a></p>
<h2>What's Changed</h2>
<ul>
<li>🌱 Bump github.com/caarlos0/env/v6 from 6.10.0 to 6.10.1 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/934">ossf/scorecard-action#934</a></li>
<li>feat: do not run signing on pull requests by <a
href="https://github.com/laurentsimon"><code>@​laurentsimon</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/935">ossf/scorecard-action#935</a></li>
<li>🌱 Bump debian from 11.4-slim to 11.5-slim by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/936">ossf/scorecard-action#936</a></li>
<li>🌱 Bump github.com/sigstore/cosign from 1.11.1 to 1.12.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/938">ossf/scorecard-action#938</a></li>
<li>🌱 Bump github/codeql-action from 2.1.22 to 2.1.24 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/941">ossf/scorecard-action#941</a></li>
<li>🐛 Restore behavior of ignoring scorecard runtime errors by <a
href="https://github.com/spencerschrock"><code>@​spencerschrock</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/948">ossf/scorecard-action#948</a></li>
<li>🌱 Bump actions/dependency-review-action from 2.1.0 to 2.4.0
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/950">ossf/scorecard-action#950</a></li>
<li>🌱 Bump github.com/sigstore/cosign from 1.12.0 to 1.12.1 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/947">ossf/scorecard-action#947</a></li>
<li>🌱 Bump github/codeql-action from 2.1.24 to 2.1.25 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/949">ossf/scorecard-action#949</a></li>
<li>🌱 Bump codecov/codecov-action from 3.1.0 to 3.1.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/942">ossf/scorecard-action#942</a></li>
<li>Create v2.0.4 patch by <a
href="https://github.com/spencerschrock"><code>@​spencerschrock</code></a>
in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/952">ossf/scorecard-action#952</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/spencerschrock"><code>@​spencerschrock</code></a>
made their first contribution in <a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/pull/948">ossf/scorecard-action#948</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/ossf/scorecard-action/compare/v2.0.3...v2.0.4">https://github.com/ossf/scorecard-action/compare/v2.0.3...v2.0.4</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="99c53751e0"><code>99c5375</code></a>
Fix - Broken dockerfile (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/979">#979</a>)</li>
<li><a
href="ff6221f234"><code>ff6221f</code></a>
New release for Scorecard v4.8.0 (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/969">#969</a>)</li>
<li><a
href="608d088417"><code>608d088</code></a>
🌱 Bump golang from <code>b850621</code> to <code>25de7b6</code>
(<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/968">#968</a>)</li>
<li><a
href="5e97403151"><code>5e97403</code></a>
🌱 Bump golang from <code>c2a98a5</code> to <code>b850621</code>
(<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/966">#966</a>)</li>
<li><a
href="851b893ef5"><code>851b893</code></a>
🌱 Bump github.com/spf13/cobra from 1.5.0 to 1.6.0 (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/967">#967</a>)</li>
<li><a
href="c9866174c7"><code>c986617</code></a>
🌱 Upgrade to go 1.19 (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/961">#961</a>)</li>
<li><a
href="c3d8fd9ebe"><code>c3d8fd9</code></a>
🌱 Bump github.com/sigstore/cosign from 1.12.1 to 1.13.0 (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/962">#962</a>)</li>
<li><a
href="6075f427dd"><code>6075f42</code></a>
🌱 Bump debian from <code>5cf1d98</code> to <code>b46fc4e</code>
(<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/959">#959</a>)</li>
<li><a
href="f3005530a0"><code>f300553</code></a>
🌱 Bump step-security/harden-runner from 1.4.5 to 1.5.0 (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/958">#958</a>)</li>
<li><a
href="de0b2c5459"><code>de0b2c5</code></a>
🌱 Bump github/codeql-action from 2.1.25 to 2.1.26 (<a
href="https://github-redirect.dependabot.com/ossf/scorecard-action/issues/957">#957</a>)</li>
<li>Additional commits viewable in <a
href="865b409285...99c53751e0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ossf/scorecard-action&package-manager=github_actions&previous-version=2.0.3&new-version=2.0.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-03 16:18:02 +00:00
.github chore(deps): bump ossf/scorecard-action from 2.0.3 to 2.0.6 (#9170) 2022-11-03 16:18:02 +00:00
.husky chore: Improve CI (#8601) 2022-07-01 15:03:12 +02:00
docker feat!: use ~/.cache/puppeteer for browser downloads (#9095) 2022-10-11 11:20:45 +00:00
docs chore: update contributing (#9202) 2022-11-03 11:08:36 +01:00
examples docs: update examples' README (#9187) 2022-11-02 11:48:27 +01:00
packages chore: release main (#9210) 2022-11-03 11:02:28 +01:00
test chore: add missing golden asset for firefox (#9171) 2022-10-27 09:33:38 +00:00
test-d feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00
tools docs: improve docs (#9179) 2022-10-28 08:49:28 +02:00
website docs: fix search bar (#9214) 2022-11-03 13:02:25 +01:00
.editorconfig EditorConfig: 2 space indent (#195) 2017-08-03 09:50:08 -07:00
.eslintignore feat!: use ~/.cache/puppeteer for browser downloads (#9095) 2022-10-11 11:20:45 +00:00
.eslintplugin.js chore: add custom rule for formatting comments (#8777) 2022-08-12 14:15:26 +02:00
.eslintrc.js chore: rename vendor to third_party (#9021) 2022-09-28 15:23:37 +02:00
.eslintrc.types.cjs fix: remove unused imports (#8613) 2022-07-01 16:00:03 +02:00
.gitattributes chore(git): Fix line endings in text files (#4320) 2019-04-22 09:03:42 -07:00
.gitignore feat!: use ~/.cache/puppeteer for browser downloads (#9095) 2022-10-11 11:20:45 +00:00
.mocharc.cjs chore: support WebDriver BiDi browser instances (#8932) 2022-09-15 02:15:15 +02:00
.npmrc fix: move CI npm config out of .npmrc (#6901) 2021-02-17 18:52:22 +01:00
.prettierignore chore: use test runner for installation tests (#9110) 2022-10-14 13:37:07 +02:00
.prettierrc.cjs docs: improve docs (#9179) 2022-10-28 08:49:28 +02:00
.release-please-manifest.json chore: release main (#9210) 2022-11-03 11:02:28 +01:00
commitlint.config.js chore: update commitlint.config.js (#9064) 2022-10-06 09:40:39 +02:00
LICENSE chore: use https URL for license info (#6279) 2020-08-10 10:35:07 +02:00
package-lock.json chore: release main (#9210) 2022-11-03 11:02:28 +01:00
package.json chore: use test runner for installation tests (#9110) 2022-10-14 13:37:07 +02:00
README.md docs: improve docs (#9179) 2022-10-28 08:49:28 +02:00
release-please-config.json chore: bootstrap release-please (#9071) 2022-10-06 12:54:24 +02:00
tsconfig.base.json feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00
versions.js chore: release main (#9168) 2022-10-26 09:51:16 +02:00

Puppeteer

Build status npm puppeteer package

Guides | API | FAQ | Contributing | Troubleshooting

Puppeteer is a Node.js library which provides a high-level API to control Chrome/Chromium over the DevTools Protocol. Puppeteer runs in headless mode by default, but can be configured to run in full (non-headless) Chrome/Chromium.

What can I do?

Most things that you can do manually in the browser can be done using Puppeteer! Here are a few examples to get you started:

  • Generate screenshots and PDFs of pages.
  • Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e. "SSR" (Server-Side Rendering)).
  • Automate form submission, UI testing, keyboard input, etc.
  • Create an automated testing environment using the latest JavaScript and browser features.
  • Capture a timeline trace of your site to help diagnose performance issues.
  • Test Chrome Extensions.

Getting Started

Installation

To use Puppeteer in your project, run:

npm i puppeteer
# or `yarn add puppeteer`
# or `pnpm i puppeteer`

When you install Puppeteer, it automatically downloads a recent version of Chromium (~170MB macOS, ~282MB Linux, ~280MB Windows) that is guaranteed to work with Puppeteer. For a version of Puppeteer without installation, see puppeteer-core.

Configuration

Puppeteer uses several defaults that can be customized through configuration files.

For example, to change the default cache directory Puppeteer uses to install browsers, you can add a .puppeteerrc.cjs (or puppeteer.config.cjs) at the root of your application with the contents

const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  // Changes the cache location for Puppeteer.
  cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};

After adding the configuration file, you will need to remove and reinstall puppeteer for it to take effect.

See the configuration guide for more information.

puppeteer-core

Every release since v1.7.0 we publish two packages:

puppeteer is a product for browser automation. When installed, it downloads a version of Chromium, which it then drives using puppeteer-core. Being an end-user product, puppeteer automates several workflows using reasonable defaults that can be customized.

puppeteer-core is a library to help drive anything that supports DevTools protocol. Being a library, puppeteer-core is fully driven through its programmatic interface implying no defaults are assumed and puppeteer-core will not download Chromium when installed.

You should use puppeteer-core if you are connecting to a remote browser or managing browsers yourself. If you are managing browsers yourself, you will need to call puppeteer.launch with an an explicit executablePath (or channel if it's installed in a standard location).

When using puppeteer-core, remember to change the import:

import puppeteer from 'puppeteer-core';

Usage

Puppeteer follows the latest maintenance LTS version of Node.

Puppeteer will be familiar to people using other browser testing frameworks. You launch/connect a browser, create some pages, and then manipulate them with Puppeteer's API.

For more in-depth usage, check our guides and examples.

Example

The following example searches developers.google.com/web for articles tagged "Headless Chrome" and scrape results from the results page.

import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  await page.goto('https://developers.google.com/web/');

  // Type into search box.
  await page.type('.devsite-search-field', 'Headless Chrome');

  // Wait for suggest overlay to appear and click "show all results".
  const allResultsSelector = '.devsite-suggest-all-results';
  await page.waitForSelector(allResultsSelector);
  await page.click(allResultsSelector);

  // Wait for the results page to load and display the results.
  const resultsSelector = '.gsc-results .gs-title';
  await page.waitForSelector(resultsSelector);

  // Extract the results from the page.
  const links = await page.evaluate(resultsSelector => {
    return [...document.querySelectorAll(resultsSelector)].map(anchor => {
      const title = anchor.textContent.split('|')[0].trim();
      return `${title} - ${anchor.href}`;
    });
  }, resultsSelector);

  // Print all the files.
  console.log(links.join('\n'));

  await browser.close();
})();

Default runtime settings

1. Uses Headless mode

Puppeteer launches Chromium in headless mode. To launch a full version of Chromium, set the headless option when launching a browser:

const browser = await puppeteer.launch({headless: false}); // default is true

2. Runs a bundled version of Chromium

By default, Puppeteer downloads and uses a specific version of Chromium so its API is guaranteed to work out of the box. To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a Browser instance:

const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'});

You can also use Puppeteer with Firefox Nightly (experimental support). See Puppeteer.launch for more information.

See this article for a description of the differences between Chromium and Chrome. This article describes some differences for Linux users.

3. Creates a fresh user profile

Puppeteer creates its own browser user profile which it cleans up on every run.

Using Docker

See our Docker guide.

Using Chrome Extensions

See our Chrome extensions guide.

Resources

Contributing

Check out our contributing guide to get an overview of Puppeteer development.

FAQ

Our FAQ has migrated to our site.