On chromium you can get the page source using GetSourceProc like in this delphi code I found on the internet:
procedure TForm1.Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
httpStatusCode: Integer);
begin
Chromium1.Browser.MainFrame.GetSourceProc(StringVisitor);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
chromium1.load('http://www.google.com');
end;
procedure TForm1.StringVisitor(const str: ustring);
begin
mySource := str;
end;
The code works fine and I can get the source from mySource variable perfectly, however when I change the data on the page and then re-call the code to get the source I get the old data, like example I have a HTML input:
<input name="edtFName" type="text" value="ZORRO" id="FName" title="First Name">
So the HTML input has the text "ZORRO" and when I change the text to "ZARA" and get the source on delphi I still get the text "ZORRO" in the input.
My question: is there a way to update the current source or get the real source from chromium on delphi?
ps. I opened the HTML page on the real chrome browser, and changed the text inside the input after that I saved the page as a new file, then I opened the new file and checked the source in it and found the old text and not the real new text, is this really the right behaviour, what if I had a big html form and a lot of data filled in it and wanted to save the page, then every thing is lost, it looks like a bug for me, because it doesn't save the current page.