Recent

Author Topic: Crossplatform WebBrowser component  (Read 17785 times)

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Crossplatform WebBrowser component
« on: November 25, 2014, 08:01:31 pm »
Hello everybody, I was wondering if there is anyway to have a webbrowser component for Lazarus apps. I am also fine with webkit as long as it's easy to use and works on the 3 main platforms.

What I want to do is display a webpage.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Crossplatform WebBrowser component
« Reply #1 on: November 25, 2014, 08:18:36 pm »
[ http://wiki.freepascal.org/Webbrowser ]
THtmlPort <--not a browser
fpbrowser <--- [ http://wiki.freepascal.org/fpbrowser ] a bit closer to a browser
LazActiveX<---only for ie
LazWebKit<---only GTK2
QT Webkit<---only qt
GeckoPort<---only with xulrunner version 1.9.2.19 you need to redist about 23mb

browser is a problem i think
« Last Edit: November 25, 2014, 08:22:16 pm by Never »
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

Zittergie

  • Full Member
  • ***
  • Posts: 114
    • XiX Music Player
Re: Crossplatform WebBrowser component
« Reply #2 on: November 25, 2014, 10:44:40 pm »
Be the difference that makes a difference

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Crossplatform WebBrowser component
« Reply #3 on: November 26, 2014, 03:46:32 am »
Very basic: lazbro: http://forum.lazarus.freepascal.org/index.php/topic,26296.0.html
If you don't mind text limited to ASCII characters #33..#126:
Code: [Select]
//Version 0.1 and 0.4
procedure TLazbro.CreateText(const ANode: TDOMText; const AParent: TWinControl);
const
  LSetOfAllow = [#33..#126];
...

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Crossplatform WebBrowser component
« Reply #4 on: December 27, 2014, 09:19:59 pm »
Thanks everybody.
LazActiveX is not an option I like because it uses IE and because it's Windows Only.
THtmlPort
fpBrowser
Lazbro
are no optionbecause as I understand they have limited functionality.


GeckoPort is interesting, annoying is that it has many files as redistribution.

I now think my best option is QT webkit.
Is there a way to use something like webkit.dll in my project even if it's not a QT project?
If not, can somebody point me or explain me a bit how to use this?

Thanks

stocki

  • Full Member
  • ***
  • Posts: 144
Re: Crossplatform WebBrowser component
« Reply #5 on: December 28, 2014, 07:59:21 am »

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Crossplatform WebBrowser component
« Reply #6 on: December 28, 2014, 12:13:09 pm »
Thanks everybody.
LazActiveX is not an option I like because it uses IE and because it's Windows Only.
THtmlPort
fpBrowser
Lazbro
are no optionbecause as I understand they have limited functionality.


GeckoPort is interesting, annoying is that it has many files as redistribution.

I now think my best option is QT webkit.
Is there a way to use something like webkit.dll in my project even if it's not a QT project?
If not, can somebody point me or explain me a bit how to use this?

Thanks

Qt have qtwebkit.dll. If you have webkit.dll then I suppose that you can use it with all ws which works under windows.

engkin

  • Hero Member
  • *****
  • Posts: 3112

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Crossplatform WebBrowser component
« Reply #8 on: December 28, 2014, 06:17:58 pm »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Crossplatform WebBrowser component
« Reply #9 on: December 28, 2014, 07:27:56 pm »
https://code.google.com/p/thtmlviewer/

Thanks for pointing that one out.

This is the THtmlPort before any lazarus/fpc support.

According to its "What's New page", it seems that it started "supporting Lazarus" since version 10, while THtmlPort is standing at version 9.45.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Crossplatform WebBrowser component
« Reply #10 on: December 28, 2014, 10:48:07 pm »
https://code.google.com/p/thtmlviewer/

Thanks for pointing that one out.

This is the THtmlPort before any lazarus/fpc support.

According to its "What's New page", it seems that it started "supporting Lazarus" since version 10, while THtmlPort is standing at version 9.45.
It does not, in some internal VCS checkin they removed all code specific to lazarus, if memory serves me right, the documentation is outdated.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Crossplatform WebBrowser component
« Reply #11 on: December 29, 2014, 01:10:38 am »
https://code.google.com/p/thtmlviewer/

Thanks for pointing that one out.

This is the THtmlPort before any lazarus/fpc support.

According to its "What's New page", it seems that it started "supporting Lazarus" since version 10, while THtmlPort is standing at version 9.45.
It does not, in some internal VCS checkin they removed all code specific to lazarus, if memory serves me right, the documentation is outdated.
It works. Not impressed by its page rendering speed on local html files. But it does work.

Downloaded HtmlViewer-115-r472.7z.
Expanded it.
Opened HtmlViewer\Demos\Main Demos\FrameDemLaz.lpi
Removed some required package (FrameViewer09 I think) from within the Project Inspector window.
Tried to compile it, failed and complained about TBaseForm at:
HtmlViewer\Demos\Main Demos\FDemUnit.pas
Code: [Select]
{$ifdef UseTNT}
    TBaseForm = TTntForm;
{$else}
    TBaseForm = TForm
{$endif}

  { TForm1 }

  TForm1 = class(TBaseForm)    //<----------------
replaced it with
Code: [Select]
{$ifdef UseTNT}
    TBaseForm = TTntForm;
{$else}
{$MACRO on}
    {$define TBaseForm := TForm}
{$endif}

  { TForm1 }

  TForm1 = class(TBaseForm)
tried again, failed at:
HtmlViewer\source\vwPrint.pas
Code: [Select]
{$ifdef LCL}
      PrnDev := TPrinterDevice(Printer.Printers.Objects[Printer.PrinterIndex]);
{$if lcl_fullversion >= 1020000}
      DevMode := PrnDev.DevModeA;
{$else}
      DevMode := PrnDev.DevMode;  //<-----------
{$ifend}
Commented it out and tried again.
Passed and worked!

taqtaq

  • New Member
  • *
  • Posts: 13
Re: Crossplatform WebBrowser component
« Reply #12 on: December 29, 2014, 02:56:44 am »

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Crossplatform WebBrowser component
« Reply #13 on: January 23, 2015, 08:23:45 pm »
I managed to recompile Lazarus using QT (very bad and unclear documentation IMHO). I try to run the qtwebkit example and it compiles. The "browser" provided as a sample lclwebkit doesn't load some pictures. And it crashes. Is this the best I can expect???

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Crossplatform WebBrowser component
« Reply #14 on: January 24, 2015, 05:41:48 am »
I managed to recompile Lazarus using QT (very bad and unclear documentation IMHO).
Which part do you think is "very bad and unclear"? http://wiki.freepascal.org/Qt_Interface
I try to run the qtwebkit example and it compiles. The "browser" provided as a sample lclwebkit doesn't load some pictures. And it crashes. Is this the best I can expect???
I really have no idea what you're talking about... see the attached screenshot

 

TinyPortal © 2005-2018