0

I'm trying to integrate a browser in a empty Windows Form but in some pages this error start poping: "An error has occurred in the script on this page" and the page gets corrupted.

https://i.stack.imgur.com/SPuYM.jpg

As you can see the top image is the error and the bottom image is the corrupted page. The last one was supposedly should be www.g2a.com

https://i.stack.imgur.com/9nFDF.jpg

The proyect was generated with this configuration: Visual Studio 2019 -> Windows Forms Application (.NET Framework). This is my code, it runs.

using System;
using System.IO;
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 bot3._0
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            webBrowser1.Navigate("http://www.google.es");
        }
    }
}

Edit: ScriptErrorsSuppressed = true dont work, it just suppress the errors but the page still corrupted.

  • 1
    Set the ScriptErrorsSuppressed property to True to avoid seeing that popup. Google "winforms feature_browser_emulation" to find out how to make the browser more compatible. – Hans Passant Apr 07 '20 at 21:46
  • Set `ScriptErrorSuppressed = true` and apply this: [How can I get the WebBrowser control to show modern contents?](https://stackoverflow.com/a/38514446/7444103) – Jimi Apr 07 '20 at 21:46
  • @HansPassant thank you it worked!! Now i have a freezing problem but i think i could find the solution. For anyone wondering this answer worked for me: https://stackoverflow.com/a/34267121/10093403 – Alvaro Gómez Apr 07 '20 at 23:37

0 Answers0