tchromium

DCEF3: How to get a screenshot

不想你离开。 提交于 2021-01-29 04:04:13
问题 How to get screenshot of browser in DCEF3? I create browser like this without VCL. The TakePicture method will only work if No debugger is used If ShowWindow is used var info: TCefWindowInfo; Settings: TCefBrowserSettings; begin FillChar(info, SizeOf(info), 0); info.width := width; info.height := height; FillChar(Settings, SizeOf(TCefBrowserSettings), 0); Settings.Size := SizeOf(TCefBrowserSettings); GetSettings(Settings); CefBrowserHostCreateBrowser(@info, FHandler, FDefaultUrl, @settings,

onBeforeBrowse event in Delphi Chromium component

…衆ロ難τιáo~ 提交于 2020-02-07 00:00:30
问题 I'm trying to use following procedure in Delphi XE2 with Chromium component (version 306): procedure TForm1.Chromium1BeforeBrowse(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; navType: TCefHandlerNavtype; isRedirect: Boolean; out Result: Boolean); but it's not working. Delphi doesn't recognize onBeforeBrowse event. Chromium seems to be correctly installed, samples are working, and I'm trying to add onBeforeBrowse event handling in GuiClient

Delphi Chromium - Iterate DOM

你说的曾经没有我的故事 提交于 2020-01-21 08:45:08
问题 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

Delphi Chromium - Iterate DOM

末鹿安然 提交于 2020-01-21 08:43:09
问题 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

TChromium : How to keep session alive

杀马特。学长 韩版系。学妹 提交于 2020-01-16 07:04:29
问题 When using DCEF3 TChromium, how can i keep the session alive ? For instance, if i go to a web-site and login on it, when i close my app and open it again, i need to login again. I want to keep the session alive, just like it would be if i use Google Chrome. I tried to add 'CefLib' on my app 'uses' clause and set 'CefCache' like the code below, but although i can see files being stored on 'cookies' folder, it seems to make no difference in keeping the session alive : program Project1; uses

Error on LoadURL with TChromium

岁酱吖の 提交于 2020-01-09 10:51:33
问题 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

Error on LoadURL with TChromium

限于喜欢 提交于 2020-01-09 10:51:31
问题 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

TChromium mouse click

拜拜、爱过 提交于 2020-01-06 14:34:45
问题 I would like to simulate the mouse click on a page. I'm using TChromium in Delphi. I've tried the following code, but it did not work. code := 'document.getElementById(_2lkdt).click();'; Chromium1.Browser.MainFrame.ExecuteJavaScript(Code, 'about:blank', 0); The page button is this: <button class="_2lkdt"> <span data-icon="send" class=""> <svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> <path fill="#263238" fill-opacity=".45" d="M1.101 21.757L23

Enumerating DOM nodes in TChromium

☆樱花仙子☆ 提交于 2019-12-30 08:24:20
问题 I am trying to enumerate DOM nodes using the following code (under XE2). I have borrowed most of this from answers given here in SO, but for some reason it's not doing anything. IOW, ProcessDOM() is not ever getting called. And, I am at my wits end. Could someone show me what I am doing wrong here. Thanks in advance. procedure ProcessNode(ANode: ICefDomNode); var Node1: ICefDomNode; begin if Assigned(ANode) then begin Node1 := ANode.FirstChild; while Assigned(Node1) do begin {Do stuff with

How to get elements by name in Delphi Chromium Embedded?

情到浓时终转凉″ 提交于 2019-12-29 01:40:08
问题 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