Skip to content
Permalink
Browse files

docs(api.md): fix exposeFunction example (#1900)

  • Loading branch information...
aslushnikov committed Jan 25, 2018
1 parent 189deb8 commit ddc59b247282774ccc53e3cc925efc30d4e25675
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/api.md
@@ -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')
);
@@ -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) => {

0 comments on commit ddc59b2

Please sign in to comment.
You can’t perform that action at this time.