Skip to content Skip to sidebar Skip to footer

Is There A Way To Visually See What Has Been Render By Phantomjs On A Browser

I know you can render/rasterize a web page to image or PDF in PhantomJS, but is there a way to do it inside a browser like for example on iframe, to use PhantomJS as an engine to s

Solution 1:

There is no built-in way of doing this and especially not in an interactive fashion. PhantomJS is headless browser, but a complete browser nonetheless. It cannot be simply put into another browser without much much work.

One could for example try to use emscripten to compile PhantomJS into pure JavaScript which can then be directly executed in a non-headless browser.

Another idea would be to use a server environment to run a PhantomJS instance, send commands to this instance through AJAX and receive the rendered output. Some suggestions here.

You would then need to add event handling on the page that displays the rendered images. Those are basically keyboard and mouse events which can be send to the server/converted process which then executes those commands through page.sendEvent(), renders the page again and sends it to the non-headless browser.

I doubt this is at all practical. You can try to use Chrome 13 to simply simulate the PhantomJS 1.x or Chrome 37/38 to simulate PhantomJS 2.

Post a Comment for "Is There A Way To Visually See What Has Been Render By Phantomjs On A Browser"