Alternatives to NPAPI plugins

点点圈 提交于 2019-12-01 02:21:56

问题


The NPAPI is being phased out by Chrome. What are the alternatives for writing NPAPI like browser plugins with cross browser support? I need to write a browser plugin which could talk to desktop based installed application. My environment is such that I have a desktop application and a web version of the same. The two need to communicate. My requirement is little more than just messaging. I need to first ascertain if the desktop application is installed. I do this by looking to windows registry for its installation information, if it is installed, I talk to the application and exchange messages.


回答1:


There's no single drop-in replacement for every possible NPAPI plugin (by design, since the same things that made NPAPI capable of doing everything made it insecure and non-portable), and nothing cross-browser except the web platform itself.

You should look at the deprecation guide's list of pointers; given that what you want to do is communicate with an application, Native Messaging is probably what you want.




回答2:


I solved the issue by completely discarding the NPPAPI plugins and instead I designed WCF based web server. My requirement was that I needed to access windows registry, file system etc and to establish a communication channel with a process running on my machine for exchanging the messages. Earlier I used to install an NPPAPI based COM plugin which will do it all for me. With diminishing support for NPPAPI, I had to look for some other way.

I designed a WCF based service which is exposed as Web Server console application. I install this application on the machine and communicate with this through Ajax calls. It's cross domain communication so I need to set proper headers in the call request/response.

As the service is encapsulated in a web server console application , I can communicate with it through XHR.



来源:https://stackoverflow.com/questions/21568920/alternatives-to-npapi-plugins

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!