Makie - Your question here

I want to develop a Makie application that can be started as a web page or as a desktop application. The main script is agnostic as to it is in a web page or in a desktop apllication. In the first case, a scrip using WGLMakie is launched, that calls the main script, and, in the second case, a script using GLMakie is launched, that calls the same main script.
The application has several pages. The first one is a login screen in which a connect button closes this screen and opens a “shopping cart” screen, where the user selects what data he wants to plot. On the top of this page, there are three buttons: graphics, download and close session. The graphics button brings to the shopping cart page (where we are now), the download to a download data screen, and the close session, brings to the login screen again.
In the shopping cart screen, once the user clicks on a visualize button, the shopping cart screen closes and a screen with the graphics opens. This graphics page/screen has, not only the graphics, but also a lot of controls to select time period and other visualization options.
I know that I can do this in WGLMakie bay navigating through pages, and in GLMakie by closing the present window and opening another window. But:

  • The buttons that close the present window and open another one:

    • in GLMakie: has to call display(fig_of_new_window)
    • in WGLMakie cannot call display(), but to redirect to the other web page

    This breaks the compatibility between web and desktop versions.

  • Prehaps the cleanup to be made when closing a screen or leaving a web page, has to be different. This brakes the compatibility, too.

  • Perhaps I have to take care of orphan listeners (ObservavbleFuncions) in different ways depending on if I am in the web or in the desktop version.

  • Any other?

So, what is the most standard solution for this problem? Is there a way to detect if I am in WGLMakie or GLMakie from inside the main (agnostic) script?
Thanks in advance.