Git Product home page Git Product logo

Comments (5)

mafredri avatar mafredri commented on June 10, 2024 3

@t-io I was curious so I decided to implement this in my Go library (cdp) and I think I know why this is not working for you, there are two reasons:

  1. After receiving a frame, you must acknowledge it (Page.screencastFrameAck) with the received session ID (e.g. do this in your screencastFrame-handler)
  2. No events also means there will be no frames, try scrolling, highlighting, writing, etc. that will trigger new frames to be created

Implemented in Go, the relevant part would look like this.

All this makes sense, from a protocol standpoint, on the other hand it's not very intuitive for a user, easy to miss.

from devtools-protocol.

auchenberg avatar auchenberg commented on June 10, 2024

Try to call Page.enable before subscribing to the events. https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-enable

from devtools-protocol.

t-io avatar t-io commented on June 10, 2024

@auchenberg thanks for the quick response.
I already enabled the page. Here is a more complete code snippet:

await Page.enable();
await Page.navigate({url: 'http://www.goodboydigital.com/pixijs/examples/12-2/'});
await Page.loadEventFired();
await Page.startScreencast({format: 'png', everyNthFrame: 1});
Page.screencastFrame( image =>{
  const {data, metadata} = image;
  console.log(metadata);
});

from devtools-protocol.

auchenberg avatar auchenberg commented on June 10, 2024

@t-io This seems like a problem with the Node client you are using. Please open the issue in the repo for the client, as this isn't a protocol issue.

from devtools-protocol.

t-io avatar t-io commented on June 10, 2024

@mafredri thanks a lot!
You are totally right. I was not aware of the fact that you have to acknowledge the frames. After I adjusted my code according your example it works.
All the frames are triggered and saved.

from devtools-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.