Login  Register

Re: Chrome DevTools Protocol and Pharo

Posted by alistairgrant on May 21, 2017; 9:25pm
URL: https://forum.world.st/Chrome-DevTools-Protocol-and-Pharo-tp4947589p4947786.html

Hi Torsten,

On Fri, May 19, 2017 at 09:20:48PM +0000, Alistair Grant wrote:

>
> On Fri, May 19, 2017 at 10:50:41PM +0200, Torsten Bergmann wrote:
> > Hi Alistair,
> >
> > cant look right now but two things:
> >
> >   - there are also events in the protocol - if we could hook Pharo into them
> >     this would solve the problem without abusing delay (because then you will
> >     get informed when the page loading is finished)
>
> That would be great.  It will be a while before I get a chance to look
> at this (I want to finish some proposed changes to the FileSystem
> packages first), but I'll try and include it then.

I've got basic event listening working.  It requires that all messages
are read asynchronously, so I'll need to change the interface to handle
that.

Knowing when a page has finished loading isn't quite as simple as
looking for an event - a page can consist of multiple frames, and
notifications are delivered for each frame.  The page I'm interested in
has around 25 frames.

If anyone has a good design pattern for writing an asynchronous
WebSocket client please let me know, I don't have anything concrete in
mind.

Thanks,
Alistair