puppeteer / puppeteer

Node.js API for Chrome

Home Page:https://pptr.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

puppeteer v1.16.0 breaks non-ASCII chars in page.setContent

phihag opened this issue · comments

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: v1.16.0
  • Platform / OS version: Linux
  • Node.js version: v10.15.3

What steps will reproduce the problem?

The following code works in puppeteer v1.15.0, but the assertion fails in puppeteer v1.16.0:

(async () => {
const browser = await require('puppeteer').launch({args: ['--no-sandbox']});
const page = await browser.newPage();
await page.setContent('_\u2714_');
require('assert')((await page.content()).includes('_\u2714_'));
})();

In other words, non-ASCII characters such as ✔ cannot be set with setContent.

The offending commit seems to be 76b24e6 .

I can't repro with the code you gave. Are you running puppeteer against an older version of chrome?

Here is a repository demonstrating the problem. If you are concerned about reproducibility, there's even a dockerfile which shows the bug.

However, in puppeteer v1.17.0, everything works again. That's good enough for me.

For the record: this was a dupe of #4443