javascript - function as argument on evaluate method on google puppeteer -
i want run function inside evaluate(), i'm passing argument, i'm getting 'func not function', missing?
puppeteer version: 10.2
platform / os version: windows 10, node 8.2.1
var func = function() { console.log("xxxxx"); }; var response = await page.evaluate( (func) => { func(); //func not function }, func);
if understand correctly, puppeteer has marshal code in evaluate function string , inject page context. can't pass function references or non-serializable across boundary.
Comments
Post a Comment