You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In webshot.phantom.js, I can get back the results of this option by grabbing the args array. Is there anyway to get the args array back to Node through your wrapper?
webshot.phantom.js
/*
* Bind the function fn to the context context in a serializable manner.
* A tiny bit of a hack.
*
* @param (String) fn
* @param (Object) context
*/
function buildEvaluationFn(fn, context) {
return function() {
var args = Array.prototype.slice.call(arguments);
console.log(JSON.stringify(context))
var adHost = args[0]['url'];
console.log(adHost);
page.evaluate(function(fn, context, args) {
eval('(' + fn + ')').apply(context, args);
}, fn, context, args);
};
}
The text was updated successfully, but these errors were encountered:
systemxcom
changed the title
Cannot access "page.content"
How to get "onResourceReceived" results back to Node through wrapper?
Dec 8, 2014
In webshot.phantom.js, I can get back the results of this option by grabbing the args array. Is there anyway to get the args array back to Node through your wrapper?
Option:
onResourceReceived: {
fn: function(response) {
}, context: {urlSource: urlLoc, capId: fileName},},
webshot.phantom.js
/*
* Bind the function
fn
to the contextcontext
in a serializable manner.* A tiny bit of a hack.
*
* @param (String) fn
* @param (Object) context
*/
function buildEvaluationFn(fn, context) {
return function() {
var args = Array.prototype.slice.call(arguments);
console.log(JSON.stringify(context))
var adHost = args[0]['url'];
console.log(adHost);
page.evaluate(function(fn, context, args) {
eval('(' + fn + ')').apply(context, args);
}, fn, context, args);
};
}
The text was updated successfully, but these errors were encountered: