Miletus Application Details

I might have overlooked it somewhere, but I'm wondering if there is a way to get information about the Miletus application itself from within the TMS WEB Core environment?

For example, it is not all that easy to get the memory usage of a web page (well, a more meaningful number than JavaScript's performance.memory.totalJSHeapSize) whereas Miletus might be able to come up with a number rather quickly. I recently ran into an issue where it ran out of memory unexpectedly.

Another example is finding out the local IP address (not the public IP address). Useful when dealing with apps that aren't necessarily connected to the Internet.

And while we're talking about the Miletus "wrapper app" (what is the correct term?) I'm also wondering if there is somewhere we can set the initial background color while the browser engine is being loaded. Defaults to white, but not sure how to change that to something else - ideally black or a custom color or maybe even a splash image would be fun.


As of right now, there is no API that allows you to get the memory usage or the local IP address directly. However these sounds like good suggestions so we'll put this on our list to consider them for a future version.

There are two possible workarounds at this moment:

  • You can write your own shared library (DLL, SO, DYLIB) to get access to these information as Miletus supports that. The idea behind supporting custom shared libraries was to be able to extend your application beyond the API we offer at any given time.
  • Try to get them through terminal commands and parse the output.

Regarding to the initial color, currently this is also not supported but we'll put this on our list too.

Ah, I had indeed overlooked TMiletusShell. Might be able to get at some of that information via your second point using this. Will see what I can figure out.

Also, regarding directing the outer Miletus app, I'm curious if it is also possible to set the original position information (particularly form height but width, top and left are good candidates as well). Perhaps these are variables that could be somehow set in the main "program" part of the project? At the moment I think it pulls the width/height from the form's design width and height at startup? And it gets the form position from the usual place.

I would also like to move the form around on the screen. Changing Form1 width and height will resize the Miletus form, which tells me it's possible :grin: I can also change the BorderStyle of Form1 at runtime and it does what one might expect. But not sure how to change the left/top properties of the application?

Another item related to the Miletus app background. It would be pretty amazing if there was an option for the background of the wrapper app to be completely transparent. Then we could design our app to essentially have a non-rectangular shape. So if everything in the app was configured in a way that its own background was also transparent, you could in theory see the desktop or other apps behind the Miletus app.

That would mean we'd need to make the browser engine in which the Miletus web app is running (semi) transparent, which I'm afraid is technically not possible but we'll have a look anyway.

You know more about the details of how this works in Miletus naturally, but the idea is that you're using some kind of "webview" container to implement the browser, and there are examples where this container in some instances can indeed be made transparent. Kind of specific to the webview container, browser engine, and so on, but there are examples where this works just fine.

The browser itself likely has no problem with this. You can for example overlay multiple <iframe> elements on a page that render content from other websites, with a background that is transparent. Works pretty well. And of course a Delphi app can be transparent.

I'm optimistic - might even be only one line of code :pray:

It's a yes and no situation: values set at design time are parsed from the DFM and packaged into the application to be readily available at application startup. Depending on the WEB application to set width/height/position values would cause flickers (as the native application that hosts the browser appears faster than the browser initializes).

Currently Width, Height, WindowState, BorderStyle, BorderIcons, and Position are supported. We'll look to see if there's anything we can do to couple Left/Top properties too, but for the rest you should be able to set these at designtime.

Probably not if we want to avoid flickering.

This will be looked at along with custom initial background colors. It's not just WebView2 we'd need to cover but WebKit/Safari and WebKitGTK as well.

I very much look forward to whatever you come up with!