Giter Club home page Giter Club logo

Comments (4)

mattsse avatar mattsse commented on June 12, 2024

Hey,
I'm generally not opposed to introducing async_trait, however I'm not quite sure whether it makes sense here.
If I understood your request correctly you want to implement support for Network.setRequestInterception? According to the docs, this is deprecated in favour of Fetch.enable. Puppeteer also seems to use Fetch.enable here, and the chromiumoxide command is here, which enables issuing of Fetch.requestPaused events.

After having a quick look at headless_chrome's method, this hook trait callback should execute on arrival of those events, correct?
There is already a way to subscribe to events, have you checked the EventListener for the Page and there is also a PR that would add event listener for the browser #39

For me this hook trait would make sense if we want to add designated support for event callbacks, but I'm not sure whether this makes a huge difference compared to the existing event stream functionality.

from chromiumoxide.

DCjanus avatar DCjanus commented on June 12, 2024

I'm tring to implement a server-side render service via headless chrome, and I need to hook all network request from the page , to make sure all components has been loaded, reject unexpected resource request to make sure our service is safe and stable.
I do believe EventListener is a useful, and I known how to use it. But it's low level API for me, same to others.
If I would implement the high level API for my self, why not for others on the same time.

from chromiumoxide.

DCjanus avatar DCjanus commented on June 12, 2024

Without async_trait, there would be some boring code for peopel who want to impl Hook trait. Of course, that's not a so important.

(Sorry for my terrible English)

from chromiumoxide.

mattsse avatar mattsse commented on June 12, 2024

I believe I got your point and I also think this may be beneficial for others, so I for sure welcome contributions on this :)

from chromiumoxide.

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.