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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -