在 C# webview 中启用 javascript

问题描述

我想在 C# webview 中启用 Javascript。但我做不到。

它给出了“Javascript错误。”

请帮忙。

请找出下面的错误

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            webbrowser2.Navigate("https://www.google.com/");

        }

        private void webbrowser1_DocumentCompleted(object sender,WebbrowserDocumentCompletedEventArgs e)
        {
           
        }
    }
}```

解决方法

可以用geckofx,比webview好用: 64 位:https://www.nuget.org/packages/Geckofx60.64/ 32 位:https://www.nuget.org/packages/Geckofx60.32/