tchromium

Getting errors creating ChromiumOSR programmatically

青春壹個敷衍的年華 提交于 2019-12-04 07:14:14
I'm trying to create ChromiumOSR programmatically but I keep getting an error (access violation). Here is sample code that causes the problem: var pChromiumOSR: TChromiumOSR; begin pChromiumOSR := TChromiumOSR.Create(Self); pChromiumOSR.OnLoadEnd := pChromiumOSRLoadEnd; pChromiumOSR.Browser.MainFrame.LoadUrl('www.google.com'); end; The problem is that pChromiumOSR.Browser.MainFrame is always nil. If I do pChromiumOSR.load('www.google.com'); I don't get any errors but it doesn't fire the onLoadend. Can anyone give me any suggestions on what I might be doing wrong? I'm using Delphi XE2 but not

TChromium ChromeTabs Not Working

岁酱吖の 提交于 2019-12-03 23:09:34
I want do a Tabs for my TChromium. I have this: Browsers: array[0..1000] of TChromium; And this ChromeTabs procedures: procedure TForm1.ChromeTabsActiveTabChanged(Sender: TObject; ATab: TChromeTab); var c:integer; begin for c := 0 to ChromeTabs.Tabs.Count do if browsers[c]<>NIL then if c=ChromeTabs.ActiveTabIndex then browsers[c].Visible:=true else browsers[c].visible:=false; end; procedure TForm1.ChromeTabsButtonAddClick(Sender: TObject; var Handled: Boolean); begin browsers[ChromeTabs.ActiveTabIndex]:=TChromium.Create(Chromium); browsers[ChromeTabs.ActiveTabIndex].OnAddressChange:=Chromium

Delphi Chromium - Iterate DOM

假装没事ソ 提交于 2019-12-01 09:01:40
I'm trying to iterate the DOM using TChromium and because i use Delphi 2007 i can't use anonymous methods, so i created a class inherited of TCEFDomVisitorOwn. My code is as below, but for some reason the 'visit' procedure is never called, so nothings happens. unit udomprinc; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ceflib, cefvcl; type TForm1 = class(TForm) Chromium1: TChromium; procedure FormCreate(Sender: TObject); procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer)

Delphi Chromium - launch a command in Delphi application when button in web page is clicked by user

一世执手 提交于 2019-11-29 07:54:11
I'm using Chromium component in a Delphi application. I'd like the following behaviour: When user clicks a specific button in a web page, the Delphi application (the 'container') must execute a command (launch an external executable with ...). Is it possible ? Update: Since you've actually asked for DOM event listener for click events, check the following example listening the Google search button click event (the element with ID gbqfba ): uses ShellAPI, cefvcl, ceflib; procedure TForm1.Button1Click(Sender: TObject); begin Chromium1.Load('www.google.com'); end; procedure OnClickEvent(const

How to get elements by name in Delphi Chromium Embedded?

旧巷老猫 提交于 2019-11-28 13:47:24
To get a particular DOM node embedded in the current web document from a TChromium instance, using its ID, you use ICefDomDocument.getElementById(). But how do you find elements by the NAME attribute? Javascript has the document.getElementsByName() method and TWebBrowser (that wraps IE) has a similar call, but I can't figure out how to do this with TChromium. I need to find some DOM elements that have NAME attributes but no ID attributes. I searched the ceflib unit and did not see anything that would do it. Side question. If anyone has a link to a TChromium "recipes" style site or document I

Error on LoadURL with TChromium

我的未来我决定 提交于 2019-11-28 11:38:56
I found the brilliant Delphi Chromium project for embedding Chrome in a Delphi form. It works well in Delphi7 after a bit of hacking and I can get the demo app running. However when I do my own app with the component, I can't load my own url. I get a access violation. Chromium2.Browser.MainFrame.LoadUrl('http://www.example.com'); The TChromium component is working and I have all the DLLs in the right place, since if I set DefaultUrl it works fine. I have Chromium2 in a TPageControl page and with the OnClick event of a button I call the above code. I get an AccessViolation. Mainframe is nil . I

Get HTML Source from Chromium Embedded

僤鯓⒐⒋嵵緔 提交于 2019-11-28 11:14:56
How to do this with Delphi Chromium Embedded Component i know how to do this with TWebBrowser. But since no docs are present for this I am sure someone else had same problem. Thanks Here is how you do it.. procedure TCustomLoad.OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); var data:tstringlist; begin data:=tstringlist.create; if frame.IsMain then data.text:=frame.Source; // HTML Source end; data.free; end; in dcef 3 procedure StringVisitor(const str: ustring); begin //str is the SourceHtml showmessage(str); end; function GetSourceHTML: string; var

Delphi Chromium - launch a command in Delphi application when button in web page is clicked by user

左心房为你撑大大i 提交于 2019-11-28 01:46:21
问题 I'm using Chromium component in a Delphi application. I'd like the following behaviour: When user clicks a specific button in a web page, the Delphi application (the 'container') must execute a command (launch an external executable with ...). Is it possible ? 回答1: Update: Since you've actually asked for DOM event listener for click events, check the following example listening the Google search button click event (the element with ID gbqfba ): uses ShellAPI, cefvcl, ceflib; procedure TForm1

Using TChromium, Delphi Chromium Embedded

女生的网名这么多〃 提交于 2019-11-27 14:30:42
This is a continuation of my last question . In that question I showed a problem involving TWebBrowser generating threads that persisted after the Browsers destruction. While noone could provide a solution to the problem, it was suggested that the problem could be a non-fixable one (a flaw with the TWebBrowser component itself). Because of this I have attempted to download and use the Delphi Chromium Embedded Framework . I downloaded the components and added them to Delphi, added one to a new form and attempted to run the program, at which point it throws up a CPU break point at 5264DF81 6A01