Handling custom URI scheme without blocking main thread?

Hello,

I’m not too familiar with GTK or WebKit relative to some other people, so I apologise if the answer to this question is obvious.
Using the Rust bindings for WebKitGTK, I’m trying to register a custom URI scheme (in my case, ipfs://) in a Web browser that I’m building with GTK. The aim is, I should be able to hook up a library that fetches content on this protocol up to my browser so that I can navigate to pages on, or view embedded content from, this protocol. I’ve got this working, but in a very unsatisfactory manner.
While I can load small amounts of content, trying to fetch anything substantial causes the whole browser to freeze and crash. A simple HTML page with a few dozen embedded images, all fetched through this custom protocol with a custom URI scheme, causes the browser to crash.
Within the context of the Rust bindings for WebKitGTK, how may I go about fetching bytes in an asynchronous (maybe that’s not the appropriate term) way? I want to mimic the behaviour that occurs when loading content over HTTP(S), where it sort of visibly loads in–y’know? Like, how images load in pieces, or pages start showing up while their embedded content (eg, images, video, JavaScript) is still loading in?
I’d appreciate any advice & help on how to achieve this. Thank you!

Kind regards,
Emil

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.