twebbrowser

TWebBrowser and FEATURE_BROWSER_EMULATION at runtime

给你一囗甜甜゛ 提交于 2019-11-29 02:40:56
Has anyone tried creating and destroying a TWebBrowser at runtime and using FEATURE_BROWSER_EMULATION to switch the browser mode before re-creating the TWebBrowser to enable switching the mode without restarting the application? I'm wondering if the setting is only read when starting the app, or when the web browser control is created. You don't need to create or destroy a TEmbeddedWB yourself. I made this (see below) to set the correct IE version for an app. Works perfecctly. You must do this before the form is created. You can do this in a initialization statement, for example: TIEMode =

How can I disable javascript errors on “TWebbrowser”?

烂漫一生 提交于 2019-11-28 11:59:52
I am getting javascript errors popping up in some webpages I am browsing to. Does anyone know how to disable javascript error boxes from displaying in a Delphi app using a TWebbrowser? or any other messageboxes? Try to set WebBrowser1.Silent := True 来源: https://stackoverflow.com/questions/2722060/how-can-i-disable-javascript-errors-on-twebbrowser

TWebBrowser crashes with embedded Youtube clips

走远了吗. 提交于 2019-11-28 11:30:51
Here is my code: type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); end; implementation uses ActiveX; procedure TForm1.Button1Click(Sender: TObject); // method 1 var HtmlFile: string; begin HtmlFile := ExtractFilePath(Application.ExeName) + 'test.html'; WebBrowser1.Navigate(HtmlFile); end; procedure LoadHtml(wb: TWebBrowser; HTMLStr: string); var aStream: TMemoryStream; begin wb.Navigate('about:blank'); // reset the webbrowser while wb.ReadyState < READYSTATE_INTERACTIVE do /

Masking floating point exceptions with Set8087CW, SetMXCSR and TWebBrowser

点点圈 提交于 2019-11-28 10:11:47
As I am receiving "Floating point division by zero" exception when using TWebBrowser and TEmbeddedWB from time to time, I discovered that I need to mask division by zero exceptions Set8087CW or SetMXCSR. Q1: What would be the best approach to do this: to mask such exceptions early in the application startup and never touch them again (the app is multithreaded)? to use OnBeforeNavigate and OnDocumentComplete events to mask / unmask exceptions? (is there a chance that exception could occur after the document is loaded?) Q2: What would be the best "command" to mask only "division by zero" and

Image from TWebBrowser to TPicture

孤者浪人 提交于 2019-11-28 06:19:05
问题 How to get an image that has been downloaded in TWebBrowser to a TPicture without copying it to clipboard or looking in to cache contents. 回答1: ok i made sample with last answer to you : fisrt get image with this function by Id : function GetImgElementById(const Doc: IDispatch; const id : string): IHTMLImgElement; var Document: IHTMLDocument2; // IHTMLDocument2 interface of Doc Body: IHTMLElement2; // document body element Tags: IHTMLElementCollection; // all tags in document body Tag:

Upload a file to a website programmatically?

别说谁变了你拦得住时间么 提交于 2019-11-28 05:59:43
问题 I am using Lazarus I have an app with webbrowser component on it that logs into a website loads a page as below (see html code below), and fills in different inputs. The last input is a file to upload. I would like my app to "click" Browse, select a file i want to, and Open. After that I could do a post the form OR just upload the file and carry on. 1 I have the following html code on the site: <td align="left" class="RequiredInput">File:</td> <td class="datafield"> <form name="frmMain" id=

How can I disable javascript errors on “TWebbrowser”?

风格不统一 提交于 2019-11-27 19:22:23
问题 I am getting javascript errors popping up in some webpages I am browsing to. Does anyone know how to disable javascript error boxes from displaying in a Delphi app using a TWebbrowser? or any other messageboxes? 回答1: Try to set WebBrowser1.Silent := True 来源: https://stackoverflow.com/questions/2722060/how-can-i-disable-javascript-errors-on-twebbrowser

How to make TWebBrowser Zoom when using ctrl+mousewheel like Internet Explorer does?

两盒软妹~` 提交于 2019-11-27 18:04:35
问题 According to http://www.rendelmann.info/blog/CommentView,guid,356fbe68-3ed6-4781-90a4-57070a0141da.aspx and http://msdn.microsoft.com/en-us/library/aa770056(v=vs.85).aspx getting the hosted WebBrowser to zoom using the control key and the mouse wheel should just require calling IWebBrowser2.ExecWB(OLECMDID_OPTICAL_ZOOM, ...) with a pvaIn value of 100 , but after calling it, ctrl+mousewheel still doesn't zoom the content Code I'm using with Delphi 2007: const OLECMDID_OPTICAL_ZOOM = 63; var

Detect when the active element in a TWebBrowser document changes

故事扮演 提交于 2019-11-27 08:46:51
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. 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 for MS Word. Sometimes, Delphi's type library importer adds event support to the Delphi TObject-descendant

Masking floating point exceptions with Set8087CW, SetMXCSR and TWebBrowser

若如初见. 提交于 2019-11-27 03:27:23
问题 As I am receiving "Floating point division by zero" exception when using TWebBrowser and TEmbeddedWB from time to time, I discovered that I need to mask division by zero exceptions Set8087CW or SetMXCSR. Q1: What would be the best approach to do this: to mask such exceptions early in the application startup and never touch them again (the app is multithreaded)? to use OnBeforeNavigate and OnDocumentComplete events to mask / unmask exceptions? (is there a chance that exception could occur