Question

The TWebBrowser component in Delphi XE2 seems to be seriously buggy. Is there some sort of code I have to run in order to instantiate it in some special way?

  1. Create new Delphi project
  2. Drop a TWebBrowser component onto the form.
  3. In Form1.FormCreate() call WebBrowser1.GoHome (to google).

If I compile this 32-bit and go to some specific webpages I get error messages. google (ncbi nucleotide blast) and click the first link.

In addition to these javascript errors if I click a link which usually opens in a new window, it opens in IE (a separate application).

The 64-bit version seems even more broken. By going to that same site (ncbi nucleotide blast) I get the entire program crashing due to a 'divide_by_zero' error.

Was it helpful?

Solution

Regarding the floating point exceptions, TWebBrowser expects to operate with floating point exceptions masked. It looks like you are using Delphi default floating point settings and have exceptions unmasked. I suspect that if you mask exceptions then your problems will disappear.

Do that like so:

SetExceptionMask(exAllArithmeticExceptions);

And as others have said, you silence the Javascript popups by setting Silent to True.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top