从Native Client / Pepper插件调用Windows API [英] Calling Windows API from Native Client/Pepper Plugin

查看:566
本文介绍了从Native Client / Pepper插件调用Windows API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意图是为windows用户创建一个chrome插件。可以从Native Client / PPAPI调用windows api。如果可能的话,怎么样?

解决方案

我回答我的问题,因为经过一些研究,我发现西方的答案有点不对。我尝试在Pepper(PPAPI)插件中调用Windows API,并且它可以很好地使用命令行开关--register-pepper-plugins(而不是West指定的--no-sandbox)。使用这个命令行属性似乎更安全,因为它只是在Chrome浏览器中注册一个插件,而不是删除任何沙箱。我想在找到一个实际使用的辣椒插件后添加一个答案,该插件使用了开关(用于chromeos的NetFlix胡椒插件)。

获得更多要添加的信息。 Chrome API提供了多监视器信息: chrome.systemInfo.display 对象提供了所有必要的信息。 chrome文档不会更新。 需要注意的是,要在清单中添加权限systemInfo.display以使用此对象 。此对象的功能中报告了两个错误。

1。 显示器名称与所有显示器Generic PnP Monitor相同,文档声称提供用户友好的显示器名称。 b $ b
2 有一个事件应该在监视器的分辨率更改时被调用,但事件永远不会被调用。



目前该实现仅适用于Windows操作系统。正在为其他操作系统提供支持。 文档说API只适用于Chrome应用,但我已经测试过了,API也可以在Chrome扩展上使用。


My intention is to create a chrome plugin for the windows users. Is that possible to call windows api from Native Client /PPAPI. If possible how?

解决方案

I am answering my question, as after some study, I found the answer from West a bit not right. I tried calling windows APIs in Pepper(PPAPI) Plugin and it works fine with a command line switch "--register-pepper-plugins" (not the --no-sandbox as specified by West). It seems safer to use this command line attribute as it is only registering a plugin in to the Chrome browser and not removing any sandbox. I thought of adding an answer after finding an actual pepper plugin existing in use, which uses the switch (the NetFlix pepper plugin for chromeos ).

Got more information to add. Chrome API is available which provides the multi-monitor information : chrome.systemInfo.display object provides all the necessary information. The chrome documentation is not updated. Important thing to note is that, the permission "systemInfo.display" is to be added in the manifest to use this object. Two bugs are reported in the functionality of this object.
1. The monitor name is same for all monitors "Generic PnP Monitor", the documentation claims to provide the user friendly name of monitors.
2. There is an event which should get invoked on resolution change of monitors, but the event is never getting invoked.

Currently the implementation is only for Windows OS. Support for other OS are on the way. Documentation says that the API is only available for Chrome App, but I haves tested that and the API is available on Chrome Extensions as well.

这篇关于从Native Client / Pepper插件调用Windows API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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