0

I wrote a simple application using webbrowser on winforms. Pages are loaded, but with some flaws, pages are displayed, but not so in Internet Explorer 11. Most java scripts do not work (and maybe all). Some sites give a warning that my browser is out of date, but I read that the webbrowser uses the built-in Internet Explorer in Windows. Why, then, does everything work in the Internet Explorer, and almost everything does not work in the webbrowser? IDE Version: Visual Studio 2019.

using System;
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;
using System.IO;
using Microsoft.Win32;

namespace WindowsFormsApp2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            webBrowser1.ScriptErrorsSuppressed = true;
            webBrowser1.Url = new Uri("https://stackoverflow.com/");
        }
    }
}
SQLprog
  • 357
  • 1
  • 3
  • 11
  • 1
    The comments on [this question](https://stackoverflow.com/questions/49948924/webbrowser-not-loading-page-that-chrome-does) seem relevant – Diado Aug 09 '19 at 08:28

1 Answers1

0

Take a look at the Windows Community Toolkit, this exposes for Windows 10 the Edge browser. https://github.com/windows-toolkit/WindowsCommunityToolkit

https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/webview

In case you have to use the default web control you can supress the warning as 'ScriptErrorsSupressed' usually does not work entirely flawless. Check the solutions posted below the answer. Disable JavaScript error in WebBrowser control

This might also be needed in case of the above, this would register your application and enforces it to use IE11. Use latest version of Internet Explorer in the webbrowser control

usselite
  • 846
  • 7
  • 24