Login  Register

Re: Chrome DevTools Protocol and Pharo

Posted by Torsten Bergmann on May 19, 2017; 11:38am
URL: https://forum.world.st/Chrome-DevTools-Protocol-and-Pharo-tp4947589p4947625.html

Alistair Grant wrote

> This looks really interesting, thanks for making it available.  I'm on
> linux, so I guess it will need some porting.

I added support for Linux and tried on Ubuntu with Chromium. Works - see screenshot

You need to load my OSLinux package (instead of OSOSX) from catalog. Or start
Chrom manually in debug mode.

In the Pharo settings browser you can set the path to the chrome executable
and the debug port to use.

Will add Windows support as well (using my OSWindows package)

> Do you know how the DevTools protocol relates to headless chome, which
> will be available in Chrome 59?
> See https://developers.google.com/web/updates/2017/04/headless-chrome

Dont know - just try it.

> In particular, is it possible to dump the DOM with your package?

I've seen that Brackets editor as well as Netbeans open Chrome to
display webpages when editing and refresh when typing. Wanted
to find out how it was done.

I have not implemented the full protocol. Only what was needed to show
that it is possible and to do things like grabbing screenshots from websites
using Pharo.

There is a DOM domain that one could wrap - basically it is just
sending JSON around, see
https://chromedevtools.github.io/devtools-protocol

With

 chrome := GoogleChrome open.
 chrome jsProtocolJSON.
 chrome browseProtocolJSON

you can now even retrieve the Protocol as JSON for the specific browser.
With a little bit more work it should be possible to even generate
the wrapper classes/methods from such a protocol spec.

Thanks
Torsten


PharoChromeUbuntu.png (680K) Download Attachment