MicrosoftDocs / winrt-api

WinRT reference content for developing Microsoft Universal Windows Platform (UWP) apps
Creative Commons Attribution 4.0 International
227 stars 495 forks source link

Possible to access WinRT components with ACUR? #1054

Open DexterWoo opened 5 years ago

DexterWoo commented 5 years ago

is it possible for ms-local-stream:/// uris to access WinRT components just like what we can do for http:// https:// and ms-appx-web:/// uris?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

jevansaks commented 5 years ago

What do you mean by "access WinRT components"? This API is designed as a hook so that you can load HTML out of an in-memory blob for WebView.

DexterWoo commented 5 years ago

I want to have the javascript code from ms-local-stream:/// to be able to call Windows runtime APIs. but it seemed not achievable.

jevansaks commented 5 years ago

I'm not sure if it's possible. @MikeHillberg do you know?

radujipa commented 4 years ago

@jwmsft @jevansaks @MikeHillberg Could you provide some details here? From the docs it pretty unclear.

On one side, Content URIs can be configured for a UWP app in the Package.appxmanifest using ms-appx-web:/// scheme. From there, a WebView can navigate to locally bundled web app provided the web app is aware of the Windows environment and adapts it's global routing (e.g. ms-appx-web:///WebApp/build/<path>). This is not feasible.

On the other hand, when the same web app is bundled with the app the WebView can use a custom UriResolver but only using the ms-appx:/// scheme which loses access to the WinRT APIs. This again is not feasible.

Given that an ordinary web app is bundled locally for offline serving, how can WinRT APIs be accessible then?

radujipa commented 3 years ago

@jwmsft @jevansaks @MikeHillberg Can we get an answer to the above please?