Recent

Author Topic: Embedded web browser howto ?  (Read 22693 times)

dimitris

  • New member
  • *
  • Posts: 9
Embedded web browser howto ?
« on: August 02, 2012, 08:59:10 pm »
Hi all,
I have been trying to find out how to embed a web browser in a Lazarus application (currently I am interested only for Windows implementation), something like TWebBrowser or better EmbeddedWB for Delphi. I have found information about several solution and tried to work on them (like Gecko or THTMLPort) but they except that I cannot find out how to install them on latest Lazarus build that I use, they seem rather poor and cannot be used to implement an application that would include a modern web browser mechanism.
A solution something like to include Chrome's mechanism or also only IE (if possible, because I am currently interested only for Windows development) would also be great.
The solution should be modern and of course stable enough.
Please reply for any information and suggestions. Thank you.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Embedded web browser howto ?
« Reply #1 on: August 02, 2012, 09:13:46 pm »
I cannot find out how to install them on latest Lazarus build that I use

Installation instructions here:

http://wiki.lazarus.freepascal.org/THtmlPort

http://wiki.lazarus.freepascal.org/GeckoPort

Thanks.

-Phil

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #2 on: August 02, 2012, 09:19:38 pm »
Hi Phil, thank you for the instructions.
Before proceeding, may I ask if these solutions can display well all modern webpages ?
And are they stable enough ?
If anyone has some feedback after using these components, regarding their stability and ability to display well all webpages, please port.
Thank you once again.

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #3 on: August 02, 2012, 09:47:53 pm »
For example, I've just downloaded and checked a demo based on HTMLport, from http://www.pbear.com/brzdemo945.exe, that's the official site for HTMLport, and when I try to see a website based on CSS and not tables, it's displayed very bad in the demo application.
This cannot be used for a serious application.
Is there some component to display well websites that use latest (...last years'...) technologies ?
Thanks.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Embedded web browser howto ?
« Reply #4 on: August 02, 2012, 09:58:16 pm »
For example, I've just downloaded and checked a demo based on HTMLport, from http://www.pbear.com/brzdemo945.exe, that's the official site for HTMLport, and when I try to see a website based on CSS and not tables, it's displayed very bad in the demo application.
This cannot be used for a serious application.
Is there some component to display well websites that use latest (...last years'...) technologies ?
Thanks.

Note that "THtmlPort" refers to the _ported_ version of Baldwin's components. What you downloaded was the original (final version) of his components, compiled by Delphi.

I was the one who ported both Baldwin's and the Gecko components, but I haven't used either for quite a while (years), so I'm not sure what state they're in currently. I see that there's now a version "2" for Gecko - you might try that.

Thanks.

-Phil

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: Embedded web browser howto ?
« Reply #5 on: August 02, 2012, 10:00:45 pm »
Hi dimitris,

TWebBrowser in Delphi is ActiveX control which dock Internet Explorer so it works only on windows (I think this controls exists for Lazarus too)

THtmlPort - this is native pascal implementation rendered by LCL, so it is multiplatform (windows, linux GTK, QT). Similar to this component is TIpHTMLPanel from TurboPower, you find example of it in lazarus_dir/examples/turbopower_ipro (you probably need instal TurboPowerIP package from menu Package -> Configure Installed Packages, I don't remember if this package is installed by default). Notice that this controls have only basic HTML (4.0?) support, no java script etc, you must do it by your self, even sockets to preview pages online

Gecko - This is full FireFox engine with everything what you need, it works similar like TWebBrowser on delphi. But this browser (gecko engine) is not installed on system by default (like TWebBrowser = Internet Explorer) so you need install xulrunner (mozilla sdk) or include it in your application installator

Details you find in links which Phil posted

Regards

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #6 on: August 02, 2012, 10:31:45 pm »
Thank you dibo too, for your very detailed answer.
I will give Geckoport a try and post my opinion. I hope it's better than HTMLport, meaning that it's able to display well modern websites.

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #7 on: August 02, 2012, 10:39:41 pm »
Which one should I prefer ? Geckoport v1 or v2 ? Why ?
Thanks.

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #8 on: August 02, 2012, 11:05:28 pm »
OK, I installed Geckoport v1, and create a very sample application with a TGeckoBrowser on a form and a button that when clicked calls form1.GeckoBrowser1.LoadURI('www.a_website.com'), just to check. I also downloaded latest xulrunner and placed in a directory named xulrunner, same directory where my project's executable is. When project starts, in the GeckoBrowser's area is displayed : "Failed to initialize TGeckoBrowser".
What am I missing ?
Thanks

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #9 on: August 03, 2012, 11:36:57 pm »
Anyway, the whole thing does not seem very stable and productive, so probably Lazarus is not ready yet to support such a type of project.
Thank you for your time.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Embedded web browser howto ?
« Reply #10 on: August 04, 2012, 04:52:58 pm »
Anyway, the whole thing does not seem very stable and productive, so probably Lazarus is not ready yet to support such a type of project.
Thank you for your time.

While it's still fresh in your mind, be sure to log the bugs and instabilities you found on the Laz Bugtracker. Select the "Lazarus CCR" tab.

I'll agree it's odd that Laz in 2012 doesn't have basic components like TWebBrowser, but someone has to step up and do it.

If you're ever interested in developing for OS X or iOS, I can show you how to add a full-featured browser control and load it with about 3 lines of code using the native Cocoa / Cocoa Touch Webkit-based controls.

Thanks.

-Phil

dimitris

  • New member
  • *
  • Posts: 9
Re: Embedded web browser howto ?
« Reply #11 on: August 04, 2012, 05:11:52 pm »
It's definitely odd that such a modern system like Lazarus does not have something stable to use for an embedded web browser.  Of course, as you write someone must deal with that and develop it. That's the "price" for such software.
About the bugs, and instabilities, it's not 2-3 bugs or problems, as you know the whole system is like playing chess. You do something and don't know what you will face next. And finally don't know if it will work (win) or not (loose).
But for sure, THTMLport is bad and a decade back regarding supporting modern websites, and TGeckoport never knew if it works (and how).
Thanks anyway.

ttomas

  • Sr. Member
  • ****
  • Posts: 250
Re: Embedded web browser howto ?
« Reply #12 on: August 04, 2012, 11:29:41 pm »
Anyone try to port ChromiumEmbedded?

http://code.google.com/p/delphichromiumembedded/
« Last Edit: August 04, 2012, 11:44:34 pm by ttomas »

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: Embedded web browser howto ?
« Reply #13 on: August 04, 2012, 11:38:03 pm »
I tried. Works very well but this is not exactly "embedded". It need to whole application be as QT widgetset application. This is big restriction in my projects

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Embedded web browser howto ?
« Reply #14 on: August 04, 2012, 11:58:52 pm »
Quote
I'll agree it's odd that Laz in 2012 doesn't have basic components like TWebBrowser, but someone has to step up and do it.
WebBrowser is NOT a basic component. Even TWebBrowser only serves as a frontend of Internet Explorer.

I've never tried GeckoPort v1, but v2 works fine here (just try the GBrowser demo) and it can display what Firefox can display correctly.

 

TinyPortal © 2005-2018