Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Button4Click(Sender: TObject; const browser: ICefBrowser;
- const frame: ICefFrame; httpStatusCode: Integer; out Result: Boolean );
- begin
- if Assigned(frame) then
- frame.VisitDomProc(OnExploreDOM);
- end;
- procedure MinimizeClickEvent(const AEvent: ICefDomEvent);
- begin
- ShowMessage('Here the application can be minimized.');
- end;
- procedure OnExploreDOM(const ADocument: ICefDomDocument);
- var
- DOMNode: ICefDomNode;
- begin
- // here we attempt to find our "minimize" element
- DOMNode := ADocument.GetElementByClassName('_2UaNq _3mMX1');
- // and if we find it, we attach to its click event our MinimizeClickEvent
- // procedure so whenever the element will be clicked, that procedure will
- // execute
- if Assigned(DOMNode) then
- DOMNode.AddEventListenerProc('click', True, MinimizeClickEvent);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement