Question

how to prevent the appearance of the dialog box This document has changed. save changes? which occurs in the transition when webbrowser about: blank

Thank you so much. did so

  Browser.Navigate ('about: blank');
  DesignMode (false ,'');
  Browser.OnNavigateComplete2: = NavigateComplite;

procedure NavigateComplite (ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
  DesignMode (true ,'');
end;
Was it helpful?

Solution

i think wich you are using the designMode property from the IHTMLDocument2 Interface in your code.

you can disable the dialog box setting this property to 'Off'.

try this code before to change to the new page

(WebBrowser1.Document as IHTMLDocument2).designMode := 'off';
WebBrowser1.Stop;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top