Re: Exposing wxWebviewHandler::StartRequest for Chromium Backends

Vadim Zeitlin <[email protected]> Sat, 10 May 2025 15:33:33 +0200
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On Thu, 8 May 2025 10:33:39 -0700 (PDT) John P wrote:

JP> Hello wx-users,
JP> 
JP> I am currently working with wxWebview using the Chromium backend. I noticed 
JP> in the documentation that StartRequest is not available for Chromium. When 
JP> looking at the source code, I noticed there is some overlap in 
JP> SchemeHandler::ProcessRequest 
JP> <https://github.com/wxWidgets/wxWidgets/blob/71654b3eb3f186f8789a4fdb47c433a9d5a6a060/src/common/webview_chromium.cpp#L1893> and 
JP> the base implementation of wxWebViewHandler::StartRequest 
JP> <https://github.com/wxWidgets/wxWidgets/blob/71654b3eb3f186f8789a4fdb47c433a9d5a6a060/src/common/webview.cpp#L185>. 
JP> In both methods, the handler routes to GetFile() and processes the result.
JP> 
JP> Would it be preferable to have SchemeHandler::ProcessRequest instead pass 
JP> through StartRequest, which would give a developer the ability to override 
JP> this method in wxWebViewHandler? This would allow Chromium backends to 
JP> access request headers and post data.

 Yes, it looks like this should be possible -- and it would definitely be
useful.

JP> Looking at the implementation for wxWebviewEdge, I understand this is not a 
JP> trivial change. I would be willing to implement this myself and open a PR, 
JP> but I wanted to get some feedback from the maintainers or anyone else who 
JP> has looked into this.

 No, I don't think anybody did. I've worked on the CEF backend relatively
recently but I concentrated on the functionality that was needed by the
application I was working on, and this was outside of it.

 But, again, after a quick look it seems that this should indeed be done
and any PRs doing it would be welcome!

 TIA,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
              https://www.tt-solutions.com/
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCaB9VrQAKCRAG6kHeT2we
hmjuAKCBsvHZf809XvK+d9j0miEBcpY0JgCfcCBYbrFdGvHls4XEO7nrb2w3j+o=
=/UPL
-----END PGP SIGNATURE-----