Commit Graph

2013 Commits

Author SHA1 Message Date
Dr
3bf5a55289
fix: update to https-proxy-agent@^5.0.0 to fix ERR_INVALID_PROTOCOL (#6555)
With `nodejs@15.0.1`, install puppeteer with `https_proxy` set causes an error like:

```
> puppeteer@5.4.1 install node_modules/puppeteer
> node install.js

ERROR: Failed to set up Chromium r809590! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new NodeError (node:internal/errors:258:15)
    at new ClientRequest (node:_http_client:155:11)
    at Object.request (node:https:313:10)
    at httpRequest (node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:488:17)
    at downloadFile (node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:357:21)
    at BrowserFetcher.download (node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:239:19)
    at async downloadBrowser (node_modules/puppeteer/lib/cjs/puppeteer/node/install.js:48:5) {
  code: 'ERR_INVALID_PROTOCOL'
}
```

The related issue is at https://github.com/TooTallNate/node-agent-base/pull/47, from package `agent-base` under `https-proxy-agent`

And the version bump is for `Refactor to TypeScript` is here: https://github.com/TooTallNate/node-https-proxy-agent/compare/4.0.0...5.0.0
2020-11-26 12:42:18 +01:00
Mathias Bynens
470124fb2b
chore: automate version bumps (#6627)
Issue: #6482
2020-11-26 11:38:24 +01:00
Michael Kebede
b57f3fcd53
feat: support promise as return value for page.waitForResponse predicate (#6624)
Co-authored-by: Joni <josalmi@google.com>
2020-11-25 11:35:47 +01:00
Greg Gorlen
3354aa7fa8
docs(api): fix misleading “seconds” for waitForTimeout (#6619) 2020-11-24 09:24:36 +01:00
Mathias Bynens
0473a2ae32
chore: bump version to v5.5.0-post (#6605) 2020-11-17 11:46:21 +01:00
Mathias Bynens
18143b3573
chore(release): mark v5.5.0 (#6604) 2020-11-16 14:38:50 +01:00
Yash Ladha
d8932ca187
chore: shorter node checker function (#6584)
`isNode` checks for the node version in which the process is running and it checks for the node key inside the versions. This is exactly the same as using `process.version` as they are set in the native code and `process.version` is just a shorthand for `process.versions.node`.
2020-11-05 07:49:58 +01:00
ghoussard
d606b8076f
docs(troubleshooting): update dumb-init version (#6585)
The latest released version of dumb-init is 1.2.2. Binary naming has changed: `dumb-init_x.x.x_amd64` became `dumb-init_x.x.x_x86_64`.
2020-11-05 07:49:20 +01:00
Yash Ladha
8690a77a2b
chore: remove redundant npm script for dependency-graph (#6583)
Remove the redundant rule for dependency graph as the `src/index.ts` is not required. This was introduced in 64c9c709, but the filestructure has changed from since then and it doesn't work as `src/index.ts` is replaced with `src/node.ts` and `src/web.ts` as per the use case.
2020-11-04 17:08:07 +01:00
Mathias Bynens
8c98315f40
chore: clarify node_js versions in Travis config (#6570)
This patch makes it so that we only refer to specific Node.js versions like `10.19.0` when we really mean to use exactly that version. Usually we just want to test the latest version in a major range, e.g. `10`.

It also adds an inline comment that makes it easier to update the versions across the file in the future (e.g. when Node.js 10 goes EOL in April 2021).

Issue: #6561
2020-11-04 12:45:52 +01:00
Mathias Bynens
6d4f0a3d06
docs(contributing): remove npm dist tags requirement (#6571)
The npm dist tags are not worth the hassle, and are arguably harmful to the Web. Developers should feel encouraged to always test the latest available Puppeteer & Chromium versions, as opposed to any specific version.

Issue: #6482
2020-11-04 07:42:45 +01:00
ExE Boss
122f074f92
fix(common): fix generic type of _isClosedPromise (#6579) 2020-11-04 07:42:23 +01:00
Johan Bay
67da1cf866
fix(domworld): fix missing binding for waittasks (#6562) 2020-11-03 10:39:31 +00:00
Jack Franklin
659193a4f5
chore: mark launcher spec as failing on Windows (#6574)
We've pushed this date back a lot, let's make it permanent until we have
more time to investigate.
2020-11-03 10:11:29 +00:00
Peter Thaleikis
3bb417b14b
chore: fix typo in test (#6566) 2020-11-01 09:43:07 +01:00
Mathias Bynens
f8cd6c4cce
chore: automate Chromium => Puppeteer version listing (#6558)
Issue: #6482
2020-10-29 22:24:35 +01:00
Mathias Bynens
8bc8a76c89
docs(api): expand registerCustomQueryHandler example (#6557)
This patch makes it easier to see exactly how to use the registerCustomQueryHandler API without having to follow the trail of breadcrumbs throughout the docs.
2020-10-29 15:22:03 +01:00
Mathias Bynens
a0d8a27856
chore: automate versioning + changelog (#6556)
As long as we follow Conventional Commits for our commit messages (which is now enforced since #6483), we can automate the maintenance of this new changelog, which enables us to later automate the release process altogether.

This patch also eliminates the versioning decision-making process by automating it based on our commit messages.

Issue: #6482
2020-10-29 10:53:51 +01:00
Joel Einbinder
b549256952 feat(chromium): roll Chromium to r818858 (#6526)
This corresponds to Chromium 88.0.4298.0.

This roll includes:

- DevTools: Wait for a frame before sending touch and wheel events
  https://chromium-review.googlesource.com/c/chromium/src/+/2437695
2020-10-27 18:15:52 +01:00
Jack Franklin
d3d7cb92eb
chore: mark v5.4.1-post (#6553) 2020-10-27 16:07:36 +00:00
Jack Franklin
562c9c2723
chore: mark version 5.4.1 (#6552) 2020-10-27 15:05:43 +00:00
Maciej Brencz
8f4a79e193
docs(troubleshooting): update Alpine Chromium version (#6529)
The latest Chromium provided by Alpine is at version 85.
2020-10-27 15:26:43 +01:00
Jack Franklin
e45acce928
chore: run unit tests on node 10.15 + fix fs.promises access (#6550)
* chore: run unit tests on node 10.15

We saw in https://github.com/puppeteer/puppeteer/issues/6548 that the
`fs.promises` module was experimental in Node <10.17 and as such we
introduced issues for users on 10.15.

Until we can drop Node v10 (it's EOL is 30-04-20201
https://github.com/nodejs/Release#release-schedule) we should run our
tests on an old Node 10 to avoid regressing in this area.

* chore: helper for importing fs safely
2020-10-26 11:02:05 +00:00
Vse Mozhe Buty
a2175c6fdc
docs(queryhandler): fix link (#6543) 2020-10-26 11:25:19 +01:00
Johan Bay
d787865066
chore: bump version to v5.4.0-post (#6544) 2020-10-26 08:27:40 +01:00
Johan Bay
729cdfe98a
chore: mark version v5.4.0 (#6542) 2020-10-23 16:28:38 +02:00
Mathias Bynens
8e9970df67
chore: automate publishing on new Git tags (#6536)
Issues: #6482
2020-10-23 14:40:14 +02:00
Johan Bay
5e5fed1deb
fix: ignore spurious bindingCalled events (#6538) 2020-10-23 12:45:47 +02:00
Jack Franklin
e6b8c77d94
chore: fix travis config (#6537) 2020-10-22 15:37:28 +02:00
Sri Harsha
c756fb495b
fix(utils): typo fix (#6522) 2020-10-19 12:45:00 +02:00
Jack Franklin
f63a123ece
chore(agnostification): agnostify web socket connections (#6520)
This PR updates the socket transport code to swap between a Node web
socket transport or a web one based on the `isNode` environment. It also
adds unit tests to the browser tests that show we can connect in a
browser.
2020-10-19 10:32:41 +01:00
Jack Franklin
c2c2bb7e55
chore(agnostification): common/helper.ts (#6515)
* chore(agnostification): common/helper.ts

The `readProtocolStream` method uses `fs` only if you want to write to a
file. So we gate at the start of the function and ensure that if we got
given a path we are not in a Node environment.
2020-10-19 09:57:15 +01:00
Jack Franklin
637a1f7409
chore: gitignore new-docs (#6511)
They are generating a lot of noise in PRs. This commit removes them from git, but updates CI to generate them - to ensure there are no errors when generating the new documentation.

Further commits will:

1. Introduce linting to enforce methods are documented.
2. Generate previews of the new docs via GitHub actions or similar.
2020-10-14 11:44:40 +01:00
Jack Franklin
e655bb6ca2
chore(agnostification): split up root Puppeteer class (#6504)
The `Puppeteer` class had two concerns:

* connect to an existing browser
* launch a new browser

The first of those concerns is needed in all environments, but the
second is only needed in Node.
https://github.com/puppeteer/puppeteer/pull/6484 landing enabled us to
pull the `Puppeteer` class apart into two:

1. `Puppeteer` which hosts the behaviour for connecting to existing
   browsers.
2. `PuppeteerNode`, which extends `Puppeteer` and also adds the ability
   to launch a new browser.

This is a non-breaking change, because Node users will still get an
instance of a class with all the methods they expect, but it'll be a
`PuppeteerNode` rather than `Puppeteer`. I don't expect this to cause
people any issues.

We also now have new files that are effectively the entry points for
Puppeteer:

* `node.ts`: the main entry point for Puppeteer on Node.
* `web.ts`: the main entry point for Puppeteer on the web.
* `node-puppeteer-core.ts`: for those using puppeteer-core (which only
  exists in Node, not on the web).
2020-10-13 16:19:26 +01:00
Ralf Vogler
f3086d7c97
fix(launcher): support relative userDataDir on headless Windows (#6506)
Launching headless with a relative `userDataDir` hangs on Windows. Fix by calling `path.resolve` (idempotent) to add an absolute path instead in `defaultArgs`.

Issues: #3453
2020-10-13 12:59:58 +02:00
Johan Bay
8fabe32800
feat(queryhandler): add built-in pierce handler (#6509)
Adds a handler 'pierce' that pierces shadow roots while querying.
2020-10-13 11:05:47 +02:00
Jack Franklin
f04bec5a15
chore: update eslint & eslint plugins (#6487)
Updates ESLint, the TypeScript ESLint plugins, and updates code where
the rules have changed.
2020-10-12 10:30:35 +01:00
Jack Franklin
4846b8723c
chore(agnostification): split up launcher class (#6484)
The `Launcher` class was serving two purposes:

1. Launch browsers
2. Connect to browsers

Number 1) only needs to be done in Node land, but 2) is agnostic; in a
browser version of Puppeteer we'll need the ability to connect over a
websocket to send commands back and forth.

As part of the agnostification work we needed to split the `Launcher` up
so that the connection part can be made agnostic. Additionally, I
removed dependencies on `https`, `http` and `URL` from Node, instead
leaning on fetch (via `node-fetch` if in Node land) and the browser
`URL` API (which was added to Node in Node 10).
2020-10-12 10:08:57 +01:00
Tim van der Lippe
1ed38af79a
chore(node): move install.ts into node/ (#6490)
This file contains logic that is unique to the Node.js environment and therefore should be moved into the `node` sub-folder.
2020-10-12 08:56:29 +02:00
Jack Franklin
e94a1e87dc
chore: bump misc dependencies (#6488)
This commit updates some miscellaneous dependencies to their latest
versions (with no other changes required) and also removes the `browser`
section, which was used by Browserify for the now long gone
Puppeteer-Web package that we used to publish.
2020-10-08 16:02:37 +01:00
Mathias Bynens
936ccdca2c
chore: enforce Conventional Commits through commitlint (#6483)
This patch sets up commitlint to enforce the Conventional Commits format. This check runs with the other lint checks as part of npm run lint, and a Git commit hook is set up via Husky for automated local checks.

Issue: #6482
2020-10-08 12:04:15 +02:00
Jack Franklin
502ed8c84c
chore(agnostify): Create Node and Web initializer. (#6477)
* chore(agnostify): Create Node and Web initializer.

This PR splits `initialize.ts` into two files, one for web, and one for
Node. The Node initializer requires much more information as it needs to
know which browser(s) to download and where to store them, whereas the
web one does not.

A future PR that I'm working on will tidy up `src/common/Puppeteer.ts`
(as it contains a lot of Node specific logic around downloading and
installing browsers), but this change enables us to stop the browser
bundle attempting to use the `pkg-dir` dependency, which wouldn't work
within a browser, as well as keeping the size of the PRs down and
avoiding one mammoth PR.
2020-10-07 14:48:01 +01:00
Johan Bay
3afe1935da
feat(a11y-query): extend aria handler with waitFor (#6472)
This commit adds waitFor to the built-in aria handler (#6307).
2020-10-07 10:49:11 +02:00
Johan Bay
cc7f1fd063
docs(queryhandler): add custom query handler docs (#6476) 2020-10-07 10:43:46 +02:00
Johan Bay
70ed875158
fix(queryhandler) only expose custom handlers (#6475)
This commit changes the custom query handler API to only operate on user-defined query handlers.
2020-10-07 10:15:54 +02:00
Johan Bay
950ae334ca
feat(a11y-query): aria query handler sans waitfor (#6459)
This commit adds a new built-in handler for querying by accessible name and role (#6307).
Support for waitForSelector will be added in a follow-up commit.
2020-10-05 08:25:55 +02:00
Maja Frydrychowicz
41ef3eec90
fix: update preferences in default Firefox profile (#6465) 2020-10-05 07:17:21 +02:00
Thomas Chaplin
9275653130
docs(examples): update selector for search example (#6471)
This commit updates the selector used in some examples as it no longer matched the target page’s DOM.

Fixes #6470, fixes #5071.
2020-10-05 06:48:34 +02:00
Johan Bay
49f25e2412
feat(chromium) roll Chromium to r809590 (#6458)
This corresponds to Chromium 87.0.4272.0
This roll includes:
- Reland "idle-detection: Implement requestPermission() method"
  (crrev.com/c/2417779)
2020-10-01 08:24:47 +02:00
Maja Frydrychowicz
4cdbebe1ac
chore: disable firefox windows launcher test until Nov (#6451) 2020-09-29 16:04:07 +01:00