twebbrowser

How to detect when a website which uses AJAX is completely loaded?

有些话、适合烂在心里 提交于 2019-12-11 04:38:46
问题 For a website, which doesn't use AJAX I'm using OnDocumentComplete event to know when the page loading is complete. My question is, how can I detect when website, which uses AJAX requests is ready (e.g. when a website which is fetching some search results by using AJAX finished its work) ? 回答1: Ok here is a trick i developed my self. 1-in your html page make a div and set its text to "false". 2-in you server side put a javascript at the end of your returning code. for example your site

downloading csv files in delphi

為{幸葍}努か 提交于 2019-12-11 04:19:07
问题 Using Indy Clients (IdHTTP) I can download csv files, if I know the actual web address of the file by using the following code, which works perfectly (original code): procedure TForm1.Button1Click(Sender: TObject); var Url, LocalFile: String; Strm: TFileStream; begin Url := 'http://www.cvrda.org/boats/cvrda_handicap/cvrda_ratings_2009.csv'; LocalFile := 'C:\cvrda_ratings_2009.csv'; Strm := TFileStream.Create(LocalFile, fmCreate); try try IdHTTP1.Get(Url, Strm); finally Strm.Free; end; except

How to show relative-path images in TWebBrowser?

余生长醉 提交于 2019-12-11 03:18:07
问题 I am using TWebBrowser in DesignMode (Doc.DesignMode := 'On') to compose a HTML document. There is no document (HTML file on disk) loaded in TWebBrowser. I create the document from zero directly in TWebBrowser. The html code will be extracted from TWebBrowser and saved as c:/MyProjects/SomeHtmlName.html. The problem is that it won't show images I insert if they have relative path. More exactly, if I paste this code in the WebBrowser it will instantly display the image: <IMG src="file:///c:

Detect cursor position in TWebBrowser at edit mode

淺唱寂寞╮ 提交于 2019-12-11 02:20:10
问题 I get selection range like this: var Range: IHTMLTxtRange; begin if Supports((Document as IHTMLDocument2).selection.createRange, IHTMLTxtRange, Range) end; TWebBrowser in editing. I need get position of cursor. How I can get its? 回答1: IHTMLTxtRange defines several attributes to get what you need. But the key items are boundingLeft and boundingTop This link has some details on how it works as well. 来源: https://stackoverflow.com/questions/2621883/detect-cursor-position-in-twebbrowser-at-edit

Delphi - How can I get a select from a twebbrowser into an array?

不打扰是莪最后的温柔 提交于 2019-12-11 01:38:13
问题 I have the following select in my twebbrowser <Select name="ship_to_method"> <option value="1941">Royal Mail Standard Delivery at £1.45 </option> <option value="1942">Courier Standard Delivery at £4.64 </option> <option value="1943">Royal Mail Priority Delivery at £1.66 </option> <option value="1944">Courier Priority Delivery at £5.15 </option> </select> the number of options and the values change dynamically, how can i get the options into an array so I have.. option_ids=(1941,1942,1943,1944

Printing from TWebBrowser

送分小仙女□ 提交于 2019-12-10 22:28:53
问题 I am using the following unit to display - and print - HTML code via a TWebBrowser which is displayed in a non-modal dialog. In my production program, the following code works under Windows-XP but fails with Windows-7 (the error message is always External exception C015D00F). In order to isolate the problem, I wrote a simple test program which also has a non-modal dialog containing a TWebBrowser; on its own, this test program works correctly with Windows-7, but when I plug the non-modal

How to change font in TWebBrowser?

百般思念 提交于 2019-12-10 22:22:15
问题 This question is related to: Which is the best way to load a string (HTML code) in TWebBrowser? Iam trying to change font in TWebBrowser with doc.body.style.fontFamily but nothing happens. The font is still TimesNewRoman. procedure THTMLEdit.SetHtmlCode(CONST HTMLCode: string); VAR Doc: Variant; begin if NOT Assigned(wbBrowser.Document) then wbBrowser.Navigate('about:blank'); WHILE wbBrowser.ReadyState < READYSTATE_INTERACTIVE DO Application.ProcessMessages; Doc := wbBrowser.Document; Doc

Which is the best way to load a string (HTML code) in TWebBrowser?

你说的曾经没有我的故事 提交于 2019-12-09 22:58:58
问题 I have a string var 'HTMLCode' that contains HTML code. I want to load this code into the browser. This is Embarcadero's code: procedure THTMLEdit.EditText(CONST HTMLCode: string); {VAR Doc: IHTMLDocument2; TempFile: string; } begin TempFile := GetTempFile('.html'); StringToFile(TempFile, HTMLCode); wbBrowser.Navigate(TempFile); Doc := GetDocument; if Doc <> NIL then Doc.Body.SetAttribute('contentEditable', 'true', 0); //crash here when I load complex html files DeleteFile(TempFile); end; It

Delphi TWebBrowser freezes GUI on Windows Startup

我怕爱的太早我们不能终老 提交于 2019-12-08 03:54:23
问题 I wrote a software and added it to windows startup. When app starts, it navigates a webpage. However, TWebbrowser freezes GUI until it is prepared to run. During this time, i can not do anything because gui is frozen. Does anyone have any solution to this? I know it is just Internet Explorer ActiveX and IE also freezing if i add it to startup. This doesn't happen if i run it second time. Only happens on Windows startup. I have XE5 here and my IE is 11. But in my office i have tested it in IE8

disable dialog webbrowser delphi

我的未来我决定 提交于 2019-12-08 01:04:33
问题 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; 回答1: i think wich you are using the designMode property from the IHTMLDocument2