Having trouble getting serialized context variables running in my onLoadFinished phantom page callback..
see: webshot#phantom-callbacks
From the docs:
Arbitrary scripts can be run on the page before it gets rendered by using any of Phantom's page callbacks
Note that the script will be serialized and then passed to Phantom as text, so all variable scope information will be lost. However, variables from the caller can be passed into the script as follows:
var options = {
onLoadFinished: {
fn: function() {
var links = document.getElementsByTagName('a');
for (var i=0; i<links.length; i++) {
var link = links[i];
link.innerHTML = this.foo;
}
}
, context: {foo: 'My custom text'}
}
};
Having trouble getting serialized context variables running in my onLoadFinished phantom page callback.. see: webshot#phantom-callbacks From the docs:
I'm seeing:
Usage:
Outcome: The one that works, works great! The one that doesn't work just hangs... doesn't throw an error, just hangs...
Please advise!