puppeteer/test
Andrey Lushnikov 5c92ba222a fix(page.evaluate): jsonValue should ignore toJSON property (#1098)
Currently, JSHandle.jsonValue() is implemented as in-page JSON.stringify
call and consequent JSON.parse in node. This approach proved to be
unfortunate for automation purposes: if page author overrode the
Object.prototype.toJSON method, then it's harder for puppeteer to
interact with the page.

This patch switches JSHandle.jsonValue to use protocol serialization
that ignores toJSON property. THis also changes the `page.evaluate`
behavior since it is based on JSHandle.jsonValue().

Fixes #1003.

BREAKING CHANGE:
`page.evaluate` no longer calls toJSON when generating return value.
For the old behavior, do JSON.parse/JSON.stringify manually:

```js
const json = JSON.parse(await page.evaluate(() => JSON.stringify(obj)));
```
2017-10-20 10:45:49 -07:00
..
assets feat(Browser): introduce Browser.pages() (#554) 2017-10-17 19:14:57 -07:00
golden test: add test to make sure clipping is correct on retina displays (#1111) 2017-10-20 10:45:22 -07:00
server [api] Implement page.authenticate method (#729) 2017-09-11 16:32:13 -07:00
diffstyle.css Implement FrameManager 2017-06-21 14:11:52 -07:00
frame-utils.js Remove promise jsdoc (#641) 2017-08-31 17:58:07 -07:00
golden-utils.js chore(doclint): move doclint tests expectations into test folders (#932) 2017-10-02 11:37:16 -07:00
test.js fix(page.evaluate): jsonValue should ignore toJSON property (#1098) 2017-10-20 10:45:49 -07:00