Commit Graph

1135 Commits

Author SHA1 Message Date
Andrey Lushnikov
d6eb3b4d52
refactor: drop object factory from execution context (#3099)
This patch:
- merges `ElementHandle` into `ExecutionContext` (for simplicity; there's no good reason to have them in separate files).
- removes the necessity to pass handle factory when creating `ExecutionContext`

This makes it easier to create execution contexts out of payloads.

References #1215
2018-08-16 16:16:27 -07:00
Tim Nolet
73c43bebd8 docs: Add Puppeteer Recorder extension to docs (#3088) 2018-08-16 14:48:50 -07:00
a-sync
395c50624c docs(troubleshooting): add libatk-bridge2.0-0 to ubuntu dependencies (#3096) 2018-08-16 14:46:59 -07:00
Andrey Lushnikov
ce783274ef
feat(chromium): roll Chromium to r583214 (#3092)
This roll includes:
- https://crrev.com/583153 - DevTools: mark execution contexts as isolated worlds
2018-08-15 18:54:36 -07:00
Andrey Lushnikov
b8e0d626f3
docs(readme): refer to awesome-puppeteer (#3062) 2018-08-10 01:34:45 -07:00
Andrey Lushnikov
3ae85e4649
docs: mention puppeteer-core (#3061) 2018-08-09 19:31:14 -07:00
Andrey Lushnikov
af361c8ed6
chore: bump version to v1.7.0-post (#3060) 2018-08-09 19:24:25 -07:00
Andrey Lushnikov
66caee4c60
chore: mark version v1.7.0 (#3059) 2018-08-09 18:53:24 -07:00
Andrey Lushnikov
be7626fa5e
fix: revert ExecutionContext reporting. (#3058)
It turned out that almost any usecase requires helper methods to access
DOM inside the ExecutionContext.

Instead of exposing execution contexts as-is, we should introduce
IsolatedWorld as a first-class citizen that will hold execution contexts
inside.
2018-08-09 18:14:21 -07:00
Joel Einbinder
28ccf5d795 docs(api.md): some grammar/wording (#3057) 2018-08-09 17:49:06 -07:00
Andrey Lushnikov
204c7ec8c4
feat: introduce puppeteer/Errors (#3056)
This patch adds a new require, `puppeteer/Errors`, that
holds all the Puppeteer-specific error classes.

Currently, the only custom error class we use is `TimeoutError`. We'll
expand in future with `CrashError` and some others.

Fixes #1694.
2018-08-09 16:51:12 -07:00
Andrey Lushnikov
231a2be971
feat: expose frame's execution contexts (#3048)
This patch exposes frame's execution contexts, making it possible
to debug extension's content scripts.

This is a resurrected #2812.
2018-08-09 14:57:08 -07:00
Vse Mozhet Byt
b84404c94e docs(api.md): fix a typo (#3055) 2018-08-09 14:45:15 -07:00
Quentin Dreyer
8c713ef1bd fix(browserfetcher): handle extract-zip errors (#3052) 2018-08-09 11:14:58 -07:00
Andrey Lushnikov
40466cb3a4
feat(launcher): ignoreDefaultArgs to accept array of options (#3049)
If `ignoreDefaultArgs` is given an array of options, than
these options will be excluded from the default command-line
flags.
2018-08-08 19:10:10 -07:00
Andrey Lushnikov
1be7545b70
chore: enhance markdown preprocessor (#3050)
Use preprocessor to make sure all the links in out README.md point
to the last-released version of documentation.

Fixes #3038.
2018-08-08 18:20:20 -07:00
Andrey Lushnikov
81d42c4688
feat: prepare for publishing puppeteer-core (#3047) 2018-08-08 15:14:23 -07:00
Andrey Lushnikov
d822401449
docs(api.md): clarify coordinate system in mouse (#3041) 2018-08-07 14:24:38 -07:00
Andrey Lushnikov
608f5b79fe
docs(api.md): clarification note on request interception (#3042)
Fixes #3040.
2018-08-07 14:24:27 -07:00
Steren
735e17e223 docs(troubleshooting): Add instructions to run on App Engine and Cloud Functions (#3021) 2018-08-07 13:22:49 -07:00
Joel Einbinder
6825088644 feat(launcher): allow options to be passed into puppeteer.defaultArgs (#2950) 2018-08-07 13:22:04 -07:00
Joel Einbinder
2e0007669d chore: upgrade to TypeScript 3.0.1 (#3024) 2018-08-06 11:31:33 -07:00
Joel Einbinder
25632133e2 feat: add option to specify the default viewport (#3005)
Fixes #1183.
2018-08-01 16:23:03 -07:00
Andrey Lushnikov
0c49bf5245
test: use new browser context for every page test (#3010)
This allows us:
- dogfood browser contexts the way we want them to be used
- simplifies the dance around service workers / cookies setting up and tier down.
2018-08-01 15:49:41 -07:00
Andrey Lushnikov
9c96a9283f
test: fix flakiness of certain extension tests (#3011) 2018-08-01 14:57:19 -07:00
Joel Einbinder
95d867aaac fix: don't emit an internal error when eval causes navigation (#3008)
When an evaluation causes a navigation, for example:
```js
await page.evaluate(() => window.reload());
```
sometimes we process the ExecutionContextDestroyed event before the ack from the evaluate. When we do get the ack from the evaluate, we try to build a JSHandle for it, and try to find the execution by id. But it is gone, and we throw an error. This patch switches createJSHandle to accept an ExecutionContext instead of just an id.

This bug was making the test `should throw a nice error after a navigation` flaky.
2018-08-01 13:53:08 -07:00
Andrey Lushnikov
e36a7ae677
chore: bump version to v1.6.2-post (#3009) 2018-08-01 13:52:34 -07:00
Paul Shibanov
fd5d95bd99 docs(troubleshooting): update Chromium package supported on Alpine (#2997) 2018-07-31 15:07:59 -07:00
Andrey Lushnikov
c018ff1555
feat(browsercontext): add BrowserContext.pages() method (#3003) 2018-07-31 13:24:29 -07:00
Nathan Shively-Sanders
25d7eff374 fix(Page): Use _pageBindings as a Map (#3001)
In accordance with its declared type, `Map<string, Function>`.
Currently, it is used as a plain old JS object. The compiler marks this
usage as an error when `noImplicitAny: true`. This change switches to
use the appropriate Map methods `has/get/set`.

Fixes #3000
2018-07-31 12:18:10 -07:00
Joel Einbinder
3335d369d3 fix: typing emoji (#2824)
This changes sendCharacter to use document.execCommand instead of sending a `'char'` event from the protocol. This is more aligned with how input would come in from emoji keyboards, and removes the 3ish byte limit on characters that can be sent which prevented larger emoji from being rendered correctly.

Emoji will still fail to type correctly if typing them into an iframe that is in shadow dom.

fixes #1096
2018-07-31 11:22:26 -07:00
Andrey Lushnikov
1931cb479e
feat(Chromium): roll Chromium to r579032 (#2989)
This patch rolls Chromium to r579032. The patch includes:
- https://crrev.com/577366 - DevTools: report redirect responses only if response interception is enabled
- https://crrev.com/577212 - DevTools: intercept requests resulting from redirects
- https://crrev.com/578934 - DevTools: Add a protocol method to insertText

Interception Logic in DevTools protocol has changed regarding redirects;
this patch migrates interceptions to dispatch "request" events based on
requestWillBeSent event.
2018-07-30 19:09:10 -07:00
Andrey Lushnikov
5bcb7cf512
test: add test with request interception and cookies (#2988)
Fixes #2970.
2018-07-30 19:05:19 -07:00
Andrey Lushnikov
862ad96bde
test: dump workers state after the test runner is terminated (#2991)
This will help us to debug the flakes on the CI.
2018-07-30 18:57:48 -07:00
Andrey Lushnikov
0c825de1f8
test: unflake page test that was causing us a lot of CI flakes (#2993) 2018-07-30 18:36:33 -07:00
Andrey Lushnikov
89f968b96a
test: try to fix CSS coverage flakes on win (#2992) 2018-07-30 18:36:21 -07:00
Andrey Lushnikov
4bbaa9d4f5
test: do not handle sigint for all the browsers launched in tests (#2990)
Puppeteer's default handler issues "process.exit(130)", causing
test runner to shut too early.

As a result, test runner doesn't show run summary.
2018-07-30 18:07:01 -07:00
Andrey Lushnikov
2c9599496a
test: make sure referer header is reported with request interception (#2986)
The referer header has been fixed some time ago.

References #469.
2018-07-30 18:05:27 -07:00
Andrey Lushnikov
d305c7d8c1
chore: bump version after minor release (#2985) 2018-07-30 18:05:10 -07:00
Donovan Allen
0b12119843 fix(NetworkManager): Remove header 'cookie' from request hash (#2954)
This fixes an issue in which a response may not be recorded or trigger an event because of differing cookie headers from the request.

References #2970
2018-07-30 17:06:53 -07:00
Andrey Lushnikov
392d3b94bd
Revert "chore(tests): redirect debugError to the output category of tests (#2969)" (#2987)
This reverts commit c5fe1dbdbb.
2018-07-30 16:41:39 -07:00
Joel Einbinder
c5fe1dbdbb chore(tests): redirect debugError to the output category of tests (#2969)
I have seen some flaky test failures where it would be nice to have run the tests with `DEBUG=puppeteer:error`. Instead of always running tests like that, I am redirecting `debugError` to the output category of the test. This is the same thing that we do for Chromium's stderr.

As a drive-by, I added an additional `debugError` where we were usually a try..finally pattern.
2018-07-30 11:16:12 -07:00
Fred Chasen
12e3510eca feat(page): add 'preferCSSPageSize' to page.pdf options (#2928)
Fixes #1963.
2018-07-26 18:51:44 -07:00
Andrey Lushnikov
78ebf401c2
chore(ci): move all CI from Node7 to Node8 (#2938)
Node 8 is the current LTS. We should use it by default on all
our CIs.
2018-07-26 16:27:11 -07:00
Andrey Lushnikov
d09b3042fd
docs(api.md): elaborate on passing arguments in waitForFunction (#2921) 2018-07-26 16:26:37 -07:00
Andy Fleming
3d12f1f279 feat(FrameManager): improve waiting for selector to be hidden error message (#2911)
Fixes #2854
2018-07-26 16:24:04 -07:00
Pavel Feldman
14e69d189c fix(pipe): make sure the pipe is not stuck (#2933)
When process is spawned with the 'pipe' set for stdout and stderr, Node expects these streams to be actually dispatched. If we don't, write into pipe becomes blocking and chrome stalls.

We work around that via setting 'ignore' to the stdin, stdout and stderr when the pipe communication channel is used.
2018-07-24 11:36:35 -07:00
Andrey Lushnikov
ca99a67aad
fix(launcher): always add about:blank to default arguments. (#2942)
Chrome Headless used to open about:blank by default; however, this
was recently changed.

We should open starting page no matter what to keep the environment
predictable.
2018-07-24 11:03:30 -07:00
Andrey Lushnikov
5b1898785b
chore(ci): yet another attempt to fix pptr@next (#2940)
References #2925.
2018-07-23 17:04:16 -07:00
Andrey Lushnikov
1d5f52e2fc
chore(ci): fix auto-publish to travis (#2931)
Fixes #2925.
2018-07-20 17:28:46 -07:00