Skip to content

[WebView2][Enhancement] Implement HttpClient for WebRequest and Headers related actions on WebView2? #21444

Description

@DevTKSS

What would you like clarification on? 🤔

  1. I readed that we should set Headers like with WebAssembly IFrame, but beeing on the Desktop Target I would think theat IFrame is not existing there?
  • I would have thought, that the AddWebResourceRequestFilter could be an option, but really most of the CoreWebView2 Props are just not implemented...
Image - same for the sense making PostWebMessageAsJson Image - and also the `NavigateWithWebResourceRequest` is not implemented... like a never ending story: Image 2. How could we implement e.g. a Download Dialog since it seems like Uno does not implement it? Image
  1. I would rather not be required to now also learn javaScript just for implementing more logic into this control then listening on changes and updating the Source, since there seem to be a way to parse Web Content from C# and xaml on the WebAssembly Target, but reading the Docs it seems like we have to now learn html + javascript and create web content in our app package just for that?

  2. Another good argument to choose the WebView2 control would have been the BasicAuthentication Navigation, but none of those methods are implemented?

Concern 📚

Developing with Uno 🛠️

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

Desktop (Windows)

Any feedback? 💬

Could add much more to the list, but its maybe missunderstand-able that Uno does state up from the 6.0 release to have this Control implemented at all targets, when the "implemented" means about 2-5 things of what we do see in the intellisense for example which are really a lot more!
When choosing Uno for my app, a strong argument is the c# type safety, which does not apply when using this efficiently would require us to revert to learn a not at all type safe language like javascript for sending a WebRequestMessage or html + css content to do some ui. Why do we then have xaml UI in Uno everywhere? maybe I am blind 🤷 but didnt that work already all the time on the WebAssembly Target? why do we now have to go back again?

Activity

  1. added
    triage/untriaged
    difficulty/tbd
    on Sep 8, 2025
  2. jeromelaban commented on Sep 9, 2025

    @jeromelaban
    Member

    Some of those features are not possible to implement on Wasm because iframe is restricted for security reasons by browsers. You may not be able to do what you want here.

    If you find a way to do what you need in javascript, document it here and it might be possible to integrate it in the WebView2 control.

  3. DevTKSS commented on Sep 9, 2025

    @DevTKSS
    ContributorAuthor

    @jeromelaban my target platform is not WebAssembly then desktop😅
    And as I wrote already, I have no clue about JavaScript, which is why I was happy that Uno is using c# and xaml bit doesnt requires us to also learn that language too.
    Seems like the WebView2 is an almost JavaScript only control which makes it really hard to use it if you don't know anything about that language except from its beeing absolutely insecure for types and you have to 1000x check the type before you use the object someone handed you out.

    Well yes, I would have the code snippet I would maybe try to do in JavaScript but its meant to be run in node.js server and is a api definition. I don't know if this is suddenly absolutely irrelevant what the code is when you write JavaScript, and would also not be able to validate anything of this code, which is the last thing you would reasonable implement then in any app...
    🫤

    If you find somebody who knows how to use JavaScript and those other web languages, then this here is the sample code in this languages I am referring to:

    And this here is what they meaning to do in clearer steps:

    I would have done this in the server project we get in uno apps but its failing on the known issue that even of my app executes fine on https, it does only start when I allow unsafe contents and up from the very start I am getting a message box error that if I close it, exits also instantly the debugger 🫤. Someone else issues that this would be caused from some webSockets error🤔 do you remember that you mentioned me telling about the mixed contents on the other issue for the server https where you created the doc page? Exactly that mixed contents. Maybe that person knows what it needs to fix that🤔🤷

    But since I am not able to use the WebAssembly target with https because of that, beside the WebAuthenticationBrokerProvider (creaded a implementation on my project I still need to test) that idea has been to use the WebView2 for something like that build in, but its unclear how to efficiently use that control from my non-existing JavaScript knowledge in uno apps with that little documentation and all of the not implemented things I found maybe suited in the Microsoft uwp documentation about this control 😟

  4. DevTKSS commented on Sep 9, 2025

    @DevTKSS
    ContributorAuthor

    🤔 okay, thats curious:
    I looked throught the source code for the WebView2 implementation and its CoreWebView2 and it seems like there are lots more Navigation functions and others actually implemented which are not contained in the Implemented Views docs (maybe because of that?) but set to internal accessor?
    https://github.com/unoplatform/uno/blob/master/src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2.cs

    I mean of course you want us to use the WebView2 in first instance, but why couldnt we use the implemented methods that is actually having and looking fine?

    • NavigateWithHttpRequestMessage(HttpRequestMessage )
    • DocumentTitleChanged is only implemented in the WebView but not WebView2

    What is the reason for those are not implemented?

    • All Print + Print to pdf and Download and Notification Events
    • All Frame Navigation and Creation Events
    • WebResource Requested/Response Events

    I mean, looking at the large Implemented Views for Windows and Device API and even our WebAssembly target, which is mainly web things like that(?) I am just wondering that this seems to be not possible for the WebView2 control 🤔 is there a specific reason or just no time so far?

    Some enhancement ideas:

    • the Navigate(Uri ) would maybe make sense to pull up to the top level WebView2 🤔
    • a DependencyProperty that could be bound to with IsWebViewAvailable() which is existing as private checking Function could be mirrored to the Top level one just to allow us binding this for CanExecute of Commands for example
  5. changed the title [-][WebView2] How to set or get Headers for Url Navigation and how to workaround all the not implemented methods?[/-] [+][WebView2][Enhancement] Implement HttpClient for WebRequest and Headers related actions on WebView2?[/+] on Sep 20, 2025
  6. added
    platform/wasm 🌐
    difficulty/challenging 🤯
    and removed
    triage/untriaged
    difficulty/tbd
    on Oct 22, 2025
  7. added theissue type on Nov 19, 2025
  8. Jen-Uno commented on Mar 6, 2026

    @Jen-Uno
    Contributor

    Validation update (2026-03-05): I reviewed this on branch fix/algolia-docsearch-duplicates-and-layout (PR #22789). This issue still persists / is not resolved by the current branch changes. Tracking and consolidation: #22788.

  9. MartinZikmund commented on May 18, 2026

    @MartinZikmund
    Member

    Thanks for the detailed write-up. A few clarifications since the issue mixes several different asks:

    On Skia Desktop (Windows), CoreWebView2.AddWebResourceRequestedFilter, the WebResourceRequested event and NavigateWithHttpRequestMessage are actually wired through to the underlying native WebView2 - you can see this in Win32NativeWebView.WebResourceRequested.cs and the WebView2_WebResourceRequested / WebView2_WithHeaders samples in our SamplesApp. So for the OAuth/Etsy scenario you described (sending an authenticated request with custom headers, or rewriting requests in-flight), you should be able to do it today on Desktop without touching JavaScript at all. If you hit a concrete issue using those APIs, a focused repro issue would help us track it.

    The remaining items - download dialog, print/print-to-PDF, frame navigation events, PostWebMessageAsJson, IsWebViewAvailable as a DP, etc. - are each separate enhancement requests with very different scope (some are per-platform native plumbing, some are public API additions). Could you split those into individual issues so they can be triaged and prioritised on their own? Bundling them here makes it hard to act on any single one. I will close this in favour of the focused issues once they are open.

  10. morning4coffe-dev commented on Aug 4, 2026

    @morning4coffe-dev
    Member

    Keeping this open as an umbrella until its remaining requests are split into focused public trackers.

    Current audit:

    • Implemented: WebResourceRequested filtering/header rewriting on supported desktop backends and document-title notifications.
    • Partial: navigation using a custom request exists internally, but the public application-facing API and platform parity are not complete.
    • Pending in feat(webview2): Improve API parity across platforms #23754: host-to-page web messaging and part of the broader WebView2 parity work.
    • Still requiring focused tracking: download APIs/events, frame lifecycle APIs, basic-auth navigation, public custom-request navigation, top-level Navigate(Uri), and availability detection.

    This issue should not be closed until each remaining accepted item has a public successor or has an explicit not-planned decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/challenging 🤯kind/documentationplatform/wasm 🌐

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions