gpt4 book ai didi

uwp - UWP 中的 web 隔间是什么意思?

转载 作者:行者123 更新时间:2023-12-04 03:25:35 24 4
gpt4 key购买 nike

UWP uri 方案的 MSDN 文档区分了 ms-appxms-appx-web用这一行:

The ms-appx-web scheme accesses the same files as ms-appx, but in the web compartment.



什么是 Web 隔间以及它如何影响应用程序的其余部分?似乎 Web View 只能访问此隔间中的内容 - 为什么会这样?

最佳答案

What is the web compartment and how does this impact the rest of the application?



简而言之,这是设计使然。加载本地 HTML 资源非常有限,除非它们与应用程序一起分发。要从您的应用程序包加载内容,请使用 Navigate带有使用 ms-appx-web 的 Uri 的方法方案。出于安全原因,从应用程序包加载 html 文件必须使用 ms-appx-web .

试想一下,如果 html 可以使用 ms-appx无限制访问本地api,您的应用程序将不安全。所以,你可以认为 ms-appx-web访问时有安全限制。而且官方文件也证实了这一点( web 隔间) .

关于uwp - UWP 中的 web 隔间是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51989334/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com