TMSFNCWebBrowser and Z-Layer issue

Hi, is there a plan to integrate the ZOrderManager from Firemonkey? The reason why I ask is I would like to draw a native Panel on top of the Browser. This works with the TWebBrowser Component, but not with yours. To achieve this on MacOS I cheated a bit with your code by adding the following work around in the initialize code:

if (FWebControl <> nil) and (FWebControl.Root <> nil) and (FWebControl.Root.GetObject is TCommonCustomForm) then
begin
LForm := TCommonCustomForm(FWebControl.Root.GetObject);
LFormView := WindowHandleToPlatform(LForm.Handle).View;
if TWebControlClassHelper(FWebControl).Fill.Kind <> TTMSFNCGraphicsFillKind.gfkNone then
begin
LFormView.addSubview(FWebBrowser);
end else
begin
LContext := TNSView.Wrap(WindowHandleToPlatform(LForm.Handle).Wnd.contentView);
LContext.addSubview(FWebBrowser);
LContext.addSubview(LFormView);
end;

This sets the Form on top of the Webbrowser and allows me to render regular FMX controls over. Android and IOS should handle this using the Controltype=Platform if the Z-Order Manager is implemented. Do you know an alternative way to do this?

Christian

Right now, it's unclear how the ZOrderManager works, we'll investigate the possibilities.

Hi,

We have investigated this here but it's currently unclear how to proceed. On macOS, it doesn't seem that the ZOrderManager is implemented. On iOS & Android, we still need more time to investigate. Unfortunately we will not be able to integrate the code you propose above, because this meddles with the form view. This could potentially break FMX applications. We'll need to allocate more time to investigate. As a workaround, you can extra the code you have right now, and apply it directly to the form constructor. To access the FWebBrowser WKWebView, you can use TMSFNCWebBrowser1.NativeBrowser which is a pointer to the WKWebView instance. This way, you do not need to reintegrate the code with each update.

Thanks for your response, yes I know Embarcadero did not implemented it for MacOS and Windows. My work around under windows was a transparent Window handle which contains the Firemonkey elements and on Mac I used the dirty hack above. It is not really the smartest way, but it did what it should do. Anyway it is fair to say that the browser is brilliant and easy to use :) I might tweak something to get the Z-Layer working on Android too. I keep you informed if you do not mind.

I do not mind feedback and improvements to our browser, it's just right now not entirely clear how to implement this without breaking existing applications, as well as making it work on all supported platforms. iOS, Android, Window, macOS and Linux. Thanks for the feedback though! Is that a live screenshot with our FNC browser implemented?

Yes, it is your browser. The content is my HbbTV stack which heavily uses the interaction between Delphi and Javascript, plus Shaka for the tv playback.
I used the official WebServer component before this and something called Scriptgate. This was extremely clunky compared to TTMSFNCWebBrowser. The new implementation is way more clean and runs at the moment without any problems under Mac and Windows.

Christian

Wow, very very nice!!

If you want, you can send us a couple of screenshots of your application demonstrating the capabilities and the used TMS Components, so we can perhaps write a blog as a showcase. Of course, this is something you need to feel comfortable with. You can send this to info@tmssoftware.com with a link to this blog post if you are interested. Please leave out sensitive information if possible

Sure, I will do so. The program will be released within the next days, so I can write something about it (without going too much in to detail).

Christian