Lazarus

Programming => Networking and Web Programming => Topic started by: krolikbest on April 09, 2021, 09:09:15 pm

Title: use web browser component or not?
Post by: krolikbest on April 09, 2021, 09:09:15 pm
I am developing a project whose task is to read information from sensors. The application works on Raspberry Pi and should be made in two falvours:
1. works without screen/monitor, then one of the application threads is a simple httpserver whose task is to present the read data in the remote browser. There is (well, will be soon) also some admin panel that allows  remote control of the application
2. works with touch screen, then i would like to use form and some web browser component in order to avoid building a regular form with buttons, grids, edits etc.  In the web browser element I could display exactly the same pages as in soulution 1.
So, in the second solution I have perhaps such options:
- thtmlViewer
- fpCef3
- don't use any visual form; just start default browser in RPi with URI on startup.
It seems to me that last fits my needs but would like to ask if is it worth to use htmlViewer or fpCef3 or maybe is there something better regarding web browser component?

Regards,
Title: Re: use web browser component or not?
Post by: devEric69 on April 09, 2021, 09:54:05 pm
Hello,

If the web interface doesn't have to be too complicated (for example, if it doesn't have to handle a CRUD data-grid), then I would launch the browser registered and installed by default in the RasbPi (simple HTML pages creation with Lazarus, in fact). THtmlViewer supports HTML framesets: I've heard that it's "old-fashioned", but I like them. I don't know neither fpCef3 (https://wiki.lazarus.freepascal.org/fpCEF3), nor other browser solutions written in Lazarus like those (https://wiki.lazarus.freepascal.org/Webbrowser).

Afterwards, if things get more complicated, it's possible to use:
- fpWeb (https://wiki.freepascal.org/fpWeb_Tutorial) (allows to emulate Php with Lazarus: web server side code)
- Pas2JS (https://wiki.lazarus.freepascal.org/pas2js) (allows to emulate Javascript with Lazarus: web client side code)
Title: Re: use web browser component or not?
Post by: egsuh on April 10, 2021, 03:15:39 am
Use general browsers. OpenURL will do everything. Htmlviewer does not support HTML5 fully.
Title: Re: use web browser component or not?
Post by: salvadordf on April 24, 2021, 02:53:01 pm
You can use CEF4Delphi with Lazarus in a Raspberry Pi to embed a Chromium based browser to your application.

See this post :
https://forum.lazarus.freepascal.org/index.php/topic,41272.msg389838.html#msg389838
Title: Re: use web browser component or not?
Post by: trev on April 25, 2021, 01:52:35 am
I always launch the user's preferred/default web browser with OpenURL() unless there's a good reason not to do so. It's more user-centric.
TinyPortal © 2005-2018