00 Votes

Delphi/Lazarus: Turn off Script Error Message in WebBrowser

Question by Guest | Last update on 2021-05-06 | Created on 2016-08-05

I am using the TWebBrowser component on my Form for displaying some website. It is known that this component is a wrapper for the Microsoft Internet Explorer.

It is working quite well, however, again and again I get a PopUp dialog window displayed containing the following warning.

Internet Explorer Script Error

An error has occurred in the script on this page.
Do you want to continue running scripts on this page?

Additionally, there are some information about the line, the error, the code and the URL.

Of course, at this point, it would be better to fix the script error directly on the website, but this is not possible because the error even occurs on usual Internet pages in the WWW to which I have of course no influence.

So, is there any possibility to get rid of this message or to suppress it?

ReplyPositiveNegative
2Best Answer2 Votes

Yes, there is a possibility.

You only have to set the property "silent" of the browser component to "true".

In Delphi you can do that in this way:

WebBrowser1.Silent := true;

And this is the Lazarus way:

Browser.ComServer.Silent := true; 

Afterwards the pop up should not be displayed anymore.
Last update on 2021-05-06 | Created on 2016-08-05

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.