It is currently Fri Nov 22, 2019 5:07 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 11:07 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1218
Location: germany
Hi,

I have the need to use the WebGadget for displaying stuff in our cross platform tools. But sadly, I struggle with the PureBasic WebGadget:

1) I have to save all content to files first, because SetGadgetItemText() works only on Windows.
2) GetGadgetItemText() seems the only option to get some information out. But only works on Windows.
3) Navigation callback only works on Windows. Really missing that...
4) Linux and Mac showing border around the gadget, Windows not. I can enable on WIndows using API, but I can't disable for Linux and MacOS. At least, I found no reliable way.
5) Looks like the PB WebGadget is broken on some more recent Linux Distributions. Or at least, it gets harder to find working distributions (see forum). So I have more support cost on such systems (users ask us how to make our software run).

In general, I'm missing control over the gadget itself and what happens inside.

I thought about embedding of Gecko, but Mozilla dropped support: https://developer.mozilla.org/en-US/docs/Gecko/Embedding_Mozilla/FAQ/Embedding_Gecko
WebKit seems very complicated to me.

Would be really great if there was a library (dll, so and dylib) which allows to create own web-render gadgets and control that in more detail.

Any ideas?

[update]Maybe BLINK is an option? http://www.chromium.org/blink It is the rendering engine of Chromium, Opera etc.[/update]


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 11:34 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3520
Location: Netherlands
Setting html code directly should work on MacOS as well.

Maybe CEF (Chromium Embedded Framework) would also be an option.

_________________
macOS 10.15 Catalina, PB 5.71 x64


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 12:14 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1218
Location: germany
wilbert wrote:
Maybe CEF (Chromium Embedded Framework) would also be an option.

Sound interesting. I will have a look!


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 12:17 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1279
Location: England
This looks like it could be interesting.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 1:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat May 05, 2007 5:31 pm
Posts: 629
Location: Linz, Austria
idle did some tests with webview a few weeks ago...


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 2:28 pm 
Offline
Addict
Addict

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3362
chi wrote:
idle did some tests with webview a few weeks ago...


Note that while the interface is cross-platform, each platform uses its own native renderer and therefore may display pages differently.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Fri Jul 20, 2018 10:02 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3408
Location: New Zealand
The webview gadget just has the added ability to inject js and css, so you can call Js functions
and have js functions call PB functions.
As far as html5 support goes it's still limited. Importing cef would be easy enough but it's seriously large
an other alternative would be scitter, though it's not MIT.

After looking into the issue I decided the easiest way to go was to use an embedded http server and at my clients request
I made it an in memory embedded http / https server which can then be used to serve to a web gadget or the local browser.
You then have the choice to use a JS framework with ajax or do server side preprocessing of the html.
I'm currently looking at doing the server side preprocessing but am still trying to decide on how to tag the html
to do replacements from callbacks.
See Civet_Server thread
viewtopic.php?f=27&t=70995
or git
https://github.com/idle-PB/pb_civet_server


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Sat Jul 21, 2018 10:36 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1654
Location: Germany
Kukulkan wrote:
I have the need to use the WebGadget for displaying stuff in our cross platform tools. But sadly, I struggle with the PureBasic WebGadget:

1) I have to save all content to files first, because SetGadgetItemText() works only on Windows.
2) GetGadgetItemText() seems the only option to get some information out. But only works on Windows.
3) Navigation callback only works on Windows. Really missing that...

Several time I have already tried to help you out with implementing some of the missing WebGadget functions for MacOS or Linux. To combine all these efforts I have posted 2 cross-platform examples which demonstrate how to implement a navigation callback and these 4 important WebGadget functions:
- GetGadgetItemText(#WebGadget, #PB_Web_HTMLCode)
- GetGadgetItemText(#WebGadget, #PB_Web_PageTitle)
- GetGadgetItemText(#WebGadget, #PB_Web_SelectedText)
- SetGadgetItemText(#WebGadget, #PB_Web_HTMLCode, HTML$)

By the way, although SetGadgetItemText(#WebGadget, #PB_Web_HTMLCode, HTML$) is documented to only work on Windows, it also seems to work fine on MacOS... :wink:


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to use another cross platform web gadget?
PostPosted: Mon Jul 23, 2018 7:18 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1218
Location: germany
Hello Shardik,

I know and I already use these in our products. Thank you for the combination! But for Linux, the Webgadget starts to make problems because on some distros it seems broken (see discussions here in the forum). Users with Windows Explorer 11 can not print (a Windows bug which is not becoming fixed on Windows 7) and I still found no way to disable the border on all target OS (Win, Lin and Mac).

So I thought that some replacement would be better. We did the same by using libcurl directly because the PB implementation is not sufficient (especially SSL/TLS smtp and some other things around keeping connections open). But some external webgadget is around 150MB (compressed) and this is very much!

Anyway, I will try again to workaround all the limitations.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye