I am running TEmbeddedwb and I got a javascript timeout error while navigating on that TEmbeddedwb .
(I do not have this error while running in my internet explorer !)

The browser asks me if I want to stop the execution of the script.
I put the TEmbeddedwb propertioes to
silent = true
dialogoBox.disableAll = true
But I still have this popup comming out !
1) why do I have this error (tested on 2pcs) while there is no error while navigating on Internet explorer
2) how to disable / hide this popup ?
regards
    unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, SHDocVw_EWB, EwbCore, EmbeddedWB;
type
  TForm1 = class(TForm)
    iemain: TEmbeddedWB;
    procedure iemainScriptError(Sender: TObject; ErrorLine, ErrorCharacter,
      ErrorCode, ErrorMessage, ErrorUrl: String;
      var ScriptErrorAction: TScriptErrorAction);
    procedure FormCreate(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.iemainScriptError(Sender: TObject; ErrorLine,
  ErrorCharacter, ErrorCode, ErrorMessage, ErrorUrl: String;
  var ScriptErrorAction: TScriptErrorAction);
begin
       MessageDlg('hello', mtWarning, [mbOK], 0);
       if ErrorCode='123' then    ScriptErrorAction := eaContinue;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
    iemain.Navigate('http://www.expedia.fr/Hotels');
end;
end.
                How to handle JavaScript error in TEmbeddedWB ?
Write a handler for the OnScriptError event and return one of the available TScriptErrorAction values in the ScriptErrorAction output parameter. To ignore the script error and continue use e.g.:
procedure TForm1.EmbeddedWB1ScriptError(Sender: TObject; ErrorLine,
  ErrorCharacter, ErrorCode, ErrorMessage, ErrorUrl: string;
  var ScriptErrorAction: TScriptErrorAction);
begin
  if ErrorCode = 123 then
    ScriptErrorAction := eaContinue;
end;
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With