Delphi WebBrowser need true source
Posted on 2012-08-20
Delphi WebBrowser view is eat spaces.
I use the webbrowser element all the time.
But I am doing an app and there is a consern it is
removing spaces (not Carrage Returns) from the text.
It is a very standard call,
I tested all Inner, outer, text and html
all return the same line of text , with only single spaces,
between works, the provider says the string should have
spaces to I can wrap at 76 Chars.
The Line I get back has 'no' Carrage returns in it , by design
HOW DO I KNOW IT IS EATING SPACES, not returning them to me.
if I I right click the window and view source you see the spaces in Notepad.
But the iall.outerHTML; innerHTML ect does not return
what I see in Notepad when I view source
HELP How do I fix this. ??
procedure TForm1.GetCompleteHTMLSource(wb: TWebBrowser);
iall : IHTMLElement;
if Assigned(wb.Document) then begin
iDoc := wb.Document as IHTMLDocument2;
iall := iDoc.body;
while iall.parentElement <> nil do begin
iall := iall.parentElement;
Memo1.Text := iall.outerHTML;