cytoscape / cytosnap

A Node.js package that renders images of Cytoscape.js graphs on the server using Puppeteer
MIT License
58 stars 11 forks source link

Should not modify phantom instance until after onLoadFinished #6

Closed maxkfranz closed 8 years ago

maxkfranz commented 8 years ago

i.e.

Shouldn't execute code in Phantom via page.evaluate() or page.evaluateJavaScript() until after onLoadFinished

phantomInstance.on('onLoadFinished', function(){
  // now we can execute
});

Otherwise, we could have a race condition where the Cytoscape instance isn't available yet, since it's loaded on DOMContentLoaded.

maxkfranz commented 8 years ago

Assume the page open promise is resolved when the page is fully loaded. Closing