Commit Graph

9 Commits

Author SHA1 Message Date
Andrey Lushnikov
ddfdaf97c5
fix(page): fix race condition in WaitTask (#2739)
This patch eliminates a common race condition with WaitTask, that
happens when predicate function gets resolved right before the execution
context gets destroyed.
This situation results in a "Cannot find context with specified id undefined"
exception.

Credits go to @jakub300 for his wonderful [investigation](https://github.com/GoogleChrome/puppeteer/issues/1325#issuecomment-395472092).

Fixes #1325.
2018-06-14 11:39:51 -07:00
Andrey Lushnikov
debfe7e0b1
fix(page): respect timeout 0 in page.waitForFunction (#2563)
The in-page task should not set timeout when timeout is 0.

Fixes #2540.
2018-05-25 16:45:04 -07:00
Andrey Lushnikov
fafd156d7b
fix(Page): support anchor navigation (#2338)
This patch fixes puppeteer navigation primitives to work with
same-document navigation.

Same-document navigation happens when document's URL is changed,
but document instance is not re-created. Some common scenarios
for same-document navigation are:
- History API
- anchor navigation

With this patch:
- pptr starts dispatching `framenavigated` event when frame's URL gets
changed due to same-document navigation
- `page.waitForNavigation` now works with same-document navigation
- `page.goBack()` and `page.goForward()` are handled correctly.

Fixes #257.
2018-04-09 23:38:20 -07:00
Andrey Lushnikov
98093f0763
feat(Chromium): roll Chromium to r548153 (#2312)
This roll includes:
- https://crrev.com/547982 - v8 roll that includes [fixed
  Runtime.callFunctionOn](1637818671) method

The upstream fix makes it possible to run frame.waitFor* functions on
pages with strict CSP.

References #1229.
2018-04-04 13:56:24 -07:00
Andrey Lushnikov
f925158733
test: add test for page.waitForFunction with script CSP (#2305)
This patch adds a test to fixate page.waitForFunction behavior
for pages with CSP.

References #1229.
2018-04-03 15:21:08 -07:00
Yaniv Efraim
dde45faaeb feat(FrameManage): improve errors from frame.waitFor* methods (#2292)
This patch adds title for WaitTask, using it later in generating error messages and
making exceptions much more traceable.

Fixes #2037
2018-03-30 12:37:56 -07:00
Yaniv Efraim
ebe17371b0 chore: break page.spec.js to smaller files (#2257)
Break some large chunks into smaller files. This change will remove ~600 lines from `page.spec.js`
2018-03-29 10:42:23 -07:00
Yaniv Efraim
abb05e069d feat(page): add an option to disable timeout for waitForFunction (#2252)
This patch adds support for `timeout: 0` to disable timeout for the following functions:
- `page.waitForFunction`
- `page.waitForXPath`
- `page.waitForSelector`
and their `frame` counterparts.

Fixes #2200
2018-03-28 16:34:37 -07:00
Yaniv Efraim
47481967c5 test: Break 'page.spec.js' to smaller files (#2218)
This patch breaks huge `page.spec.js` into a bunch of smaller files.
2018-03-19 20:00:12 -07:00