Page 1 of 1

WebViewGadget deployment and other questions

Posted: Tue Mar 19, 2024 12:43 pm
by Kukulkan
Hi, I just consider using the new WebViewGadget as the basis for a new cross platform app. Unfortunatelly, I found no details about how the WebViewGadget works.
  • What is the underlying technology on Windows, Linux (QT/GTK) and MacOS?
    -> Linux webkit, macOS webkit, windows Edge webview2
  • What are the deployment ressources I need to provide if I deploy such app?
    • Do I need to deploy the WebView2 runtimes on Windows?
      -> Looks like my setup has to check if it is available and needs to download/run if needed.
    • Is there a specific webbrowser that must be installed on Linux? On Mac?
  • Are there dependencies or minimum requirements regarding the supported OS?
    • Does it work with, for example, MacOS Mojave?
    • How about Ubuntu 20.04 or even 18.04?
  • How does this gadget handle IndexedDB and localStorage usage? What are the dependencies?
  • Will it run WASM (WebAssembly)? I know this mainly depends on above answers about underlying technology...
    -> Likely
  • How does this work with proxy settings and PAC files? Do I have to implement this by myself or is this done by the OS (Win/Lin/Mac)?
UPDATE:
I will put the answers I got in this initial post into my questions list above. So we can see what is still unanswered :wink:

Re: WebViewGadget deployment and other questions

Posted: Tue Mar 19, 2024 5:57 pm
by infratec
Linux webkit
macOS webkit
windows Edge webview2

If you own a up to date Win10 version, 'Microsoft Edge WebView2-Runtime' is installed.
For older systems you have to install it by hand.

I use my own WebView2Gadget(), since not all stuff what I needed is not available in PB (up to now).

I already stumpled above some macOS webkit problems, but they were solvable.

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 9:30 am
by Kukulkan
Thanks! I updated my question above with your answers. Still a lot questions open...

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 9:46 am
by infratec
You don't need a web-browser.
You use the WebViewGadget() :wink:

Proxy is a problem on Linux and macOS.
On windows I implemented this in my WebView2Gadget(), the PB WebViewGadget() does not support it (up to now)

Or you have to use the global Proxy settings of the OS, which is not nice.

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 10:26 am
by Kukulkan
Thanks. But isn't there the issue that the webkit engine on Linux and Mac is not there by default? At least for Linux I believe I have to add some dependency. So is it libQt5WebKit5 or libwebkit2gtk or webkit2gtk3 or webkit2gtk4?
Proxy is a problem on Linux and macOS.
In the past my app had it's own proxy settings and put the proxy data to libcurl. I was using a pacparser library (DLL, .so, .dylib, self compiled) on all three platforms to determine the proxy to use in networked and mobile environments. I hoped that, using WebViewGadget, I can rely on the OS to handle this. So if the system Webbrowser works, the WebView also does. Is there any reference to test or validate this?
Or you have to use the global Proxy settings of the OS, which is not nice.
Which means I have to search and use them. Not sure if this is the way to go... Is there even a function in WebViewGadget to set the proxy to use? The announcement does not even mention proxy server...

I have many end users in company environments. They need proxy settings in order to work.

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 11:17 am
by the.weavster
The dependencies for webview are detailed on github.

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 11:53 am
by Kukulkan
The dependencies for webview are detailed on github.
Wait a second, Fred is using this webview project for implementing the WebView? :shock: Are you 100% sure that this is used and Fred did not implement it by himself? This webview project is currently version 0.10 with no official stable release yet and I doubt this is a good solution. Sounds like a can of worms to me...

During my project investigations I reviewed this project and found it not sufficient. I found IndexedDB issues there in Oct 2023 and tried to get help (finally on discord). That was not good and not helpful at all. I then filed a "feature request" issue but found that no one cares. IndexedDB and localStorage is still not consistently working or supported. Setting a proxy is not supported (only using environment variables on luck). So I dropped this and if PB uses the same project as backend, I might need to drop it right here :-(

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 2:28 pm
by Fred
I can confirm we use this project, the guys were actually helpful and accepted 2 pulls requests to ease PB integration. BTW, the WebViewGadget() primary goal is to have web based UI, not to have a full fledged emdeded browser with proxy support, localstorage and such. These should be done in the PureBasic part of the program.

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 3:31 pm
by skywalk
Hi Fred,
Is there an official gui example/doc with the webviewgadget and Javascript callbacks?

I read similar projects in the forum.

I am debating use of canvas based grids vs html gui.

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 3:59 pm
by Fred
Doc is coming with next beta :)

Re: WebViewGadget deployment and other questions

Posted: Wed Mar 20, 2024 4:01 pm
by skywalk
Thanks!