I'm trying to use the WebBrowser in WPF C# to navigate through the Internet. However, when I get to certain webpages e.g. 9gag.com the JavaScript parts of the page don't work and throw an WebBrowser specific error. Since some pages use JavaScript to navigate to their login, I want to enable JavaSrcipt in the WebBrowser and not just ignore the errors!
I use this setup:
namespace WebBrowserHelloworld
{
public partial class MainWindow : Window
{
WebBrowser mainBrowser = new WebBrowser();
public MainWindow()
{
InitializeComponent();
mainBrowser.Source = new Uri("https://google.com");
maingrid.Children.Add(mainBrowser);
}
}
}
If possible I would like to keep this setup but I appreciate other solutions as well! Thank you! (This is my first question posted, please tell me if I can improve the question!)