Darian Miller 361 Posted August 8, 2019 I'm starting a new Windows desktop application project (VCL or FMX not yet decided) and one of the functionality requirements is a built-in web browser. Is CE4 the way to go these days? https://github.com/salvadordf/CEF4Delphi It's been a long while since I last integrated a browser into a Delphi app and would appreciate any pointers. Functionality includes navigating to saved links and saving HTML source/images of visited pages. Thanks, Darian Share this post Link to post
Dave Nottage 557 Posted August 9, 2019 A while ago I was looking for something that's cross-platform (Windows and macOS) so decided to check out CE4. For me, it was extremely difficult to work with, if the goal is to use it for automation. I ended up using TWebBrowser in FMX and wrote a bunch of helper methods for both platforms, one of the most critical being: // macOS class function THTMLHelper.GetBrowserDocument(const ABrowser: TObject): DOMDocument; var LWebView: WebView; begin Result := nil; if Supports(ABrowser, WebView, LWebView) then Result := LWebView.mainFrame.DOMDocument; end; // Windows class function THTMLHelper.GetBrowserDocument(const ABrowser: TObject): IHTMLDocument3; var LBrowser: IWebBrowser; begin if Supports(ABrowser, IWebBrowser, LBrowser) then Supports(LBrowser.Document, IHTMLDocument3, Result); end; 1 1 Share this post Link to post
Rollo62 536 Posted August 9, 2019 @Dave Nottage Thanks for sharing, did you also get it working with the mobile frameworks ? Share this post Link to post
baeckerg 6 Posted August 9, 2019 Thanks for sharing - my understanding is that the FMXBrowser is independent of the framework. @Dave NottageWould you share all your enhancements or do you host it somewhere? Github? I think it would be much appreciated Share this post Link to post
Dave Nottage 557 Posted August 9, 2019 3 hours ago, Rollo62 said: Thanks for sharing, did you also get it working with the mobile frameworks ? I haven't had the need to, however I might take a look at it 1 hour ago, baeckerg said: Would you share all your enhancements or do you host it somewhere? I'll work on sharing the parts that I can share. Share this post Link to post
baeckerg 6 Posted August 9, 2019 Great - did not want to intrude on any intellectual property Share this post Link to post
Rollo62 536 Posted August 9, 2019 37 minutes ago, Dave Nottage said: I haven't had the need to, however I might take a look at it That would be great. This is something I assume that is done internally by TMS WebCore, but from my understanding what I asked them, this is a internal WebBrowser, not opened for the normal use, but seems only for internal processing. So that answer took me away from testing and purchasing this product,, but a reliable bridge between Delphi and browser with all modern JS features is a big thing IMHO, and could even take over some parts of the growing node.js ecosystem a little bit. Share this post Link to post
Микола Петрівський 10 Posted August 9, 2019 If you only need to display HTML written by yourself, then THtmlViewer might be an option. Share this post Link to post