twebbrowser

How do I avoid the OnDocumentComplete event for embedded iframe elements?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 21:01:38
问题 I want to prevent iframe elements from triggering the OnDocumentComplete event every time. For example, a page has 4 iframes, and when I load this page, my OnDocumentComplete event runs 4 times. I want to run OnDocumentComplete just once for every page. How can I do that? Maybe I could remove or block iframes in TWebBrowser control. 回答1: The event OnDocumentComplete is fired for each FRAME / IFRAME in the main document. If you want to ignore them try this: procedure TForm1

Detect when the active element in a TWebBrowser document changes

只愿长相守 提交于 2019-11-26 14:20:03
问题 Is there any event I can hook into to detect when the active element on a web page changes? For example, when a the user focuses an edit box. I know I could check the active element in a timer, but I'd rather avoid this if possible. 回答1: This isn't - quite - a complete answer to your q, but hopefully will get you most of the way there. (For future readers who arrive here via a similar q: Suppose you have an type library import unit for an automation/Com server like SHDocVw, MSHTML or the one

How to have Delphi TWebbrowser component running in IE9 mode?

♀尐吖头ヾ 提交于 2019-11-26 08:38:48
I am experiencing Javascript errors with TWebbrowser due to the fact that TWebbrowser is running in IE7 compatibility mode. Is there a way to prevent this and just have it run in IE9 mode? Opt in to the browser emulation feature using the documented registry key . Depending on the browser emulation setting that you selected, you may need to ensure that your document contains a suitable DOCTYPE. Again, this is described in the documentation . So, for example, if you wish to make the simplest possible change you would add the following registry setting: HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)

How to have Delphi TWebbrowser component running in IE9 mode?

这一生的挚爱 提交于 2019-11-26 01:08:48
问题 I am experiencing Javascript errors with TWebbrowser due to the fact that TWebbrowser is running in IE7 compatibility mode. Is there a way to prevent this and just have it run in IE9 mode? 回答1: Opt in to the browser emulation feature using the documented registry key. Depending on the browser emulation setting that you selected, you may need to ensure that your document contains a suitable DOCTYPE. Again, this is described in the documentation. So, for example, if you wish to make the