Skip to content

Commit

Permalink
docs(api.md): fix exposeFunction example (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Jan 25, 2018
1 parent 189deb8 commit ddc59b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api.md
Expand Up @@ -806,7 +806,7 @@ const crypto = require('crypto');

puppeteer.launch().then(async browser => {
const page = await browser.newPage();
page.on('console', msg => console.log(msg.text));
page.on('console', msg => console.log(msg.text()));
await page.exposeFunction('md5', text =>
crypto.createHash('md5').update(text).digest('hex')
);
Expand All @@ -828,7 +828,7 @@ const fs = require('fs');

puppeteer.launch().then(async browser => {
const page = await browser.newPage();
page.on('console', msg => console.log(msg.text));
page.on('console', msg => console.log(msg.text()));
await page.exposeFunction('readfile', async filePath => {
return new Promise((resolve, reject) => {
fs.readFile(filePath, 'utf8', (err, text) => {
Expand Down

0 comments on commit ddc59b2

Please sign in to comment.