[UWP] [JS]在UWP托管的Web应用程序中从JavaScript获取内存使用情况 [英] [UWP][JS]Getting memory usage from JavaScript in UWP hosted web app

查看:52
本文介绍了[UWP] [JS]在UWP托管的Web应用程序中从JavaScript获取内存使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


是否有一个API可以在JavaScript托管的UWP应用中使用?


要求是访问内存使用情况直接从应用程序(将此信息显示给托管的Web应用程序的用户),因此不使用外部工具从外部访问此信息。


查看https://博客。 windows.com/buildingapps/2017/06/28/uwp-app-diagnostics/似乎可以从软件包中进行诊断,但这可以通过托管应用程序的JavaScript来实现吗?


谢谢,


Tomas Beranek


解决方案


Hi
Tomas Beranek



首先,UWP中有API来查询内存使用情况。你可以访问
MemoryManager类



您可以在托管的Web应用程序中调用这些API。但是您需要在清单中配置内容URI,以便您可以使用windows.external.notify
发送
ScriptNotify事件
,以便APP调用这些API。





最好的问候,



罗伊


Hello,

is there an API to use in hosted UWP app from JavaScript?

The requirement is to access memory usage directly from the application (to display this information to the user of the hosted web app), so not accessing this information from outside using an external tool.

Looking at https://blogs.windows.com/buildingapps/2017/06/28/uwp-app-diagnostics/ it seems, that diagnostics is possible from within the package, but is this possible to do from the hosted app's JavaScript?

Thank you,

Tomas Beranek

解决方案

Hi Tomas Beranek,

First, there are APIs in UWP to query the memory usage. You could access the MemoryManager Class.

You could call these APIs in hosted web app. But you need to configure the Content URIs in the manifest so that you could use windows.external.notify to send a ScriptNotify event to the APP to call these APIs.

Best regards,

Roy


这篇关于[UWP] [JS]在UWP托管的Web应用程序中从JavaScript获取内存使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆