Skip to content

Insert text in a website #2749

Description

@eduardoagr

I have a Webview2, that loads this page https://quillbot.com/grammar-check and a ViewModel, that has text.

What I want to do, is to put my text into the grammar editor

and execute everything in the VM, but because the webview is not MVVM friendly, I had to use code behind

I already tried this

`public SpellCheckWindow()
{
InitializeComponent();
ConfigureSite();
}

private async void ConfigureSite()
{
    await web.EnsureCoreWebView2Async();
    web.Source = new Uri("https://quillbot.com/grammar-check");
    web.NavigationCompleted += Web_NavigationCompleted;
}

private async void Web_NavigationCompleted(object? sender, CoreWebView2NavigationCompletedEventArgs e)
{
    var msg = "Hello from a newly loaded .NET window.";
    var elem = await web.ExecuteScriptAsync($"document.getElementById('GRAMMAR_EDITOR').innerHTML");
}

`
but it doesn't work

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions