Xojo and WebKit integration

The integration of WebKit and the Chromium Embedded Framework (CEF) is a very interesting and powerful extension to Xojo. However, the potential of this integration is only available very rudimentarily and developers can only use basic functions at the moment.

Many software developments already use the possibility to integrate JavaScript, CSS and HTML for certain parts of their software – like dashboards, special editors, for web developments, graphical representations and listings and much more.

If you look at those applications that already use CEF, you will recognize many known products. See https://en.wikipedia.org/wiki/Chromium_Embedded_Framework

I believe that we need only a few additional extensions (consistent across all platforms) in order to make better use of this. This was already demanded also in other threads on this forum.

  • EvaluateJavaScript – first of all - availability on all platform (also iOS)
    A good extension would be - if we could give the EvaluateJavaScript function a return value as well. A JSON string with data or a boolean value to determine if a function was execute correctly

Please also allow communication in the other direction – JavaScript to Xojo

  • Maybe with JavaScript callbacks – register a function which you can call from JavaScript and this calls an event in Xojo like “xojo.doSomething(“hello”);”

Please see
https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md

I think a similar technique is used by PhoneGap/Apache Cordova to make many things possible.

The use of NewWindow and TitleChanged events are not very flexible and modern concepts to combine Xojo with this powerful browser.

Richard, you should file a feature request with the feedback application. It is the only way to have the ear of Xojo engineers.

Just created a FC: <https://xojo.com/issue/48140>

Some of those features are available through the MBS plugins and you can also do the EvaluateJavascript, on macOS, through declares…

Please check MBS Plugin with chromium classes:

http://www.monkeybreadsoftware.net/pluginpart-chromium.shtml

We also have WebKit classes for Linux. And a lot of classes for Mac as well as functions for IE.

We love the MBS plugins (we bought most of them and use them a lot) but in this case we would aspire a consistent cross-platform solution in both ways and the CEF would provide all features to implement such a solution.

A cross platform solution is difficult. You can write your own methods to abstract the details, but each browser is internally implemented very differently.

Of course we understand that such a solution isn’t that easy but we would only refer to WebKit respectively CEF (no InternetExplorer or anything like that). I think they should be quite similar - not?
In my opinion this would a great extension for Xojo which is known for seamless and powerful cross-platform solutions.

No.
WebKit on Linux has a c API we can use.
Chromium has a different C API on Windows.
And one Mac we have objective C API from Apple.

They all have similar features but some things are missing or handled very different.

So it’s hard to use on different platforms.
It would be great if these features were implemented by Xojo via a simplified interface.

Just this morning I added more properties to my WKWebViewControlMBS control.

In general I try to have all platforms equal feature wise.