-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Allow hosting of UWP apps inside UWP apps #66
Comments
This is almost a more scoped version of a request around app extensions. I mean if we just had C# Roslyn code generation supported in the sandbox, then we could leverage |
This is different from app extensions as this should allow you to host a whole uwp app that is activated with |
The title makes me think "UWP Inception" :) Could the entire app be built as a custom control to achieve something like this ? That way we could leverage all the control library features for sharing/tooling etc ? I suppose that needs extra work on the app side as opposed to just embedding the app wholesale though. |
Would this allow apps to host apps that host apps that host app ... ? How would/could this impact performance (which is one of the selling points of UWP)? Could we end up in the situation where UWP apps end up just like NPM modules, where we host an app for everything resulting in dozen dependencies? |
Nested hosting would be less useful so it's certainly not a requirement. |
Correct me if I am wrong,, My People relies on app hooks. That's the reason why Facebook or Messenger doesn't tie into it. |
I am not sure all UWP app developers would like other apps "hosting" their app within other apps. But, there could be a mechanism for an app creating a "hostable" page or UI - which could be used within other apps. Some examples being
Whether this UI appears in a popup window, or appears embedded in a Provider Hosting control. There would have to be behavioural hooks, so the main app hands over to another app, and is unable to log keystrokes or otherwise intercept the other app's control. But there be a way to handshake so hosted app content can return control to the main app, and send some kind of status message perhaps? |
This is more in line with what I was thinking, it makes sense to require the hosted app supported being hosted and provide a specific page for that. |
But if you try to host a page that already hosts content? E.g. I want to host a discord chat which uses a hosted youtube player? |
I don't think it's a useful feature by any means. It looks like a specific need for your app, but I can hardly imagine some other UWP app needing to be hosted in another one. This will bring confusion as well. For example, what if I don't want my UWP app to be hosted in another app? Or let's say I want to, how can I restrict some apps or how am I supposed to allow some apps? I am not even talking about technical difficulties for sandboxed environment being hosted in another sandboxed environment here. These are just permission management stuff. Personally I don't find this feature useful or providing value to the framework itself. |
Sure it has some uses, and maybe this should be allowed, but the main focus would be non-nested hosting. |
Its a feature used by both My People and Xbox game bar so clearly it has some uses. |
I don't think it will work like that. I own AppA. You own AppB. I allow developers to host my app. Your AppB hosts my AppA. Then I update my app to host another UWP app called AppC. Or, I update it to host even your AppB. Suddenly your AppB hosts AppC inside my AppA, or there is a host-ception issue :) You can't rely on some other developer's app or published store app to just behave as it was in development stage of yours. Just because some internal apps are using it doesn't mean that whole framework development effort should be re-directed to it. There might be useful cases, but those cases are very unique and minor. The reason why they are intended to be used only internally is that they are unique to Microsoft. Not to an external developer. If your argument is 'Microsoft internally has it, just enable us to do it as well', then allowing this to public will require a lot of tooling development for VS, some changes to developer portal in web and hard thinking on corner cases. Like, the app you're hosting might not be available for user region. You handled this problem with your solution with the help of MyTube developer as it needed to be handled. That is the correct way to fix this problem. Enabling all devs to host any UWP app they want from Store is not a fix at all. |
Interesting. This scenario is more like an App model scenario rather than WinUI scenario. Just thinking about the security implications here, it could take a tremendous amount of time to design it, if the security team doesn't block it, of course, but I think there are a lot of chances this happen. Adding @AdamBraden , who works in the app model, for awareness. |
This can be solved by just not allowing nested hosting, or maybe by requiring nested hosting be enabled for all apps in the hosting chain. |
Better off just using hooks. |
You can already host another app using Launcher.LaunchForResults. |
This is super interesting, thank you! At least in theory there's support for this through a combination of App Extensions and App Services that would let you put an iframe-like thing in your app from another app.
There are security concerns for the hosting app, as they're effectively running code (JavaScript) from another app under their own identity. There's ways to control access from the JavaScript runtime to the host, and the WebView can use the "out of process" model to further isolate it. But it is possible. And It's nowhere near the model proposed on the thread so far, but it's something that works today. We understand the challenges associated with (a) writing part of your app in HTML and another in XAML (b) using AppServices efficiently as part of an interactive application. If we do something more here, we'd follow the same model that app extensions use - the hosted app would say "this is the part of me that I'm OK to have hosted elsewhere" and use capabilities to verify that the hosting app is who they want to be. We'd also want app A's code to run inside app A's process and app B's code to run in app B's, while getting an input/output pipe between them. A core issue for all apps is lifecycle - if A hosts B hosts C then the system needs to keep all of them alive. These would also necessarily be optional and somewhat ephemeral - the user can choose to uninstall B or A at any time, and the hosting app needs to be OK with a "this child thing disappeared" message. So yes - I've got a lot of ideas here, but we're looking to the community to know whether this is something we should spend additional resources on, either at the platform layer or in Project Reunion. For now, please pile onto this thread:
|
This idea has great potential, may be in future the whole windows shell could be a UWP app and other developers can just make different shells as UWP app just like how Android handles Launchers. |
Mail, Calendar is a combined app. And I think the People app provides a "picker" interface. So you can use one app to load content from another UWP app - if that app provides the support. |
@mdtauk I know Mail and Calender are in the same package but how UI from People from Calender? I only know about launching for results which would show a modal window but this seems something only Microsoft can do |
I imagine its through this API https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.provider?view=winrt-19041 |
No those APIs for adding yourself to the File/Folder Picker. I think this is some undocumented stuff that only Microsoft knows |
Subset of the feature already in Game Bar Widget Overview, Anyone know that UI Extension host available in SDK to let us mirrow two UWP Apps? |
I did something horrifying in microsoft/terminal@main...dev/migrie/fhl/dyndep that let an "extension host" app package load WinRT runtimeclasses from another package. This just used the public SDK, and dynamic dependencies. It's all in-proc though, so reliability is suspect at best. I didn't get it loading a I'm pretty sure @jonwis has explicitly warned me not to try this in the past (again, reliability issues), but I had to see if it was possible 😄 |
Ow, my eyes. The main problem here is that UWP code is not usually designed to be loaded into other apps' appcontainers. That is, when you use dynamic dependency to bring in Which means it's also something of a security risk - if your app manages credentials, and you load a DLL from another app, that other app now has access to your app's credentials. Normally this would be blocked by UWPs and appcontainers, as they can't reach-across container boundaries directly. This somewhat breaks the user's mental notion of "store apps" and UWPs - apps are isolated from each other and the system, and they have to directly approve when two apps want to work together. So if you are doing this in terminal, @zadjii-msft , please make sure there's a user-consent prompt. I won't say "dyndep allows app 1 to load code from app 2 is a bug" as it's something app1 decided to do. But it's a sharp tool to be used carefully. In another world entirely we'd fully support cross-app-package composition islands, so you host the visuals of another app without loading its code into your process. As other have noted above, this is how the Xbox GameBar as well as various Picker types work. We just never enabled it for UWPs. |
Proposal: Allow hosting of UWP apps inside UWP apps
Summary
It would be awesome to be able to host a UWP app insider of another one.
This would be similar to what both My People and Xbox game bar do.
Rationale
I am one of the developers of Quarrel which is an unofficial UWP discord client.
The developer of MyTube (an unofficial UWP YouTube client) kindly provided us with a dll that contains large parts of the MyTube code that allows us to host an instance of MyTube inside Quarrel to provide youtube embeds in a way that does not require us to pull in a webview.
However, it would be much better if we could host the store version of MyTube inside Quarrel similarly to how Xbox game bar can host UWP apps.
I imagine there are many other similar cases in which other developers would find this useful.
Scope
Open Questions
The text was updated successfully, but these errors were encountered: