# puppeteer-in-electron

> Run puppeteer within an electron app.

Latest version **3.0.5** (published 2021-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install puppeteer-in-electron
pnpm add puppeteer-in-electron
yarn add puppeteer-in-electron
bun add puppeteer-in-electron
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.5 |
| Published | 2021-06-29 |
| First published | 2019-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 27.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 359 |
| Author | Trevor Sundberg |
| Maintainers | trevorsundberg |
| Keywords | electron, puppeteer |

## Links

- npm: https://www.npmjs.com/package/puppeteer-in-electron
- Repository: https://github.com/TrevorSundberg/puppeteer-in-electron
- Homepage: https://github.com/TrevorSundberg/puppeteer-in-electron#readme
- Issues: https://github.com/TrevorSundberg/puppeteer-in-electron/issues
- npm.io page: https://npm.io/package/puppeteer-in-electron

## Dependencies (7)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [get-port](https://npm.io/package/get-port.md) ^5.1.1
- [@types/uuid](https://npm.io/package/@types/uuid.md) ^3.4.6
- [async-retry](https://npm.io/package/async-retry.md) ^1.3.1
- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) ^2.5.4
- [@types/async-retry](https://npm.io/package/@types/async-retry.md) ^1.4.1
- [@types/puppeteer-core](https://npm.io/package/@types/puppeteer-core.md) ^1.9.0

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 3.0.5 (latest) — 2021-06-29
- 3.0.4 — 2021-06-10
- 3.0.3 — 2020-06-30
- 3.0.2 — 2020-06-03
- 3.0.1 — 2020-05-16
- 3.0.0 — 2020-03-20
- 2.0.4 — 2020-03-15
- 2.0.3 — 2020-03-15
- 2.0.2 — 2020-03-01
- 2.0.1 — 2020-03-01
- 2.0.0 — 2020-03-01
- 1.0.9 — 2020-03-01
- 1.0.8 — 2020-01-10
- 1.0.7 — 2019-09-06
- 1.0.6 — 2019-09-05
- … 5 more at https://npm.io/package/puppeteer-in-electron/versions

## README

# Introducing puppeteer-in-electron
Use puppeteer to test and control your electron application.
```
npm install puppeteer-in-electron puppeteer-core electron
```

See the [API documentation](/API.md).

# JavaScript
```javascript
const {BrowserWindow, app} = require("electron");
const pie = require("puppeteer-in-electron")
const puppeteer = require("puppeteer-core");

const main = async () => {
  await pie.initialize(app);
  const browser = await pie.connect(app, puppeteer);
 
  const window = new BrowserWindow();
  const url = "https://example.com/";
  await window.loadURL(url);
 
  const page = await pie.getPage(browser, window);
  console.log(page.url());
  window.destroy();
};

main();
```

# TypeScript
```typescript
import {BrowserWindow, app} from "electron";
import pie from "puppeteer-in-electron";
import puppeteer from "puppeteer-core";

const main = async () => {
  await pie.initialize(app);
  const browser = await pie.connect(app, puppeteer);

  const window = new BrowserWindow();
  const url = "https://example.com/";
  await window.loadURL(url);

  const page = await pie.getPage(browser, window);
  console.log(page.url());
  window.destroy();
};

main();
```

---
_Source: https://npm.io/package/puppeteer-in-electron · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
