Encapsulate ActiveX for JavaScript

ぐ巨炮叔叔 提交于 2019-12-23 16:03:42

问题


I'm trying to develop an website that can use a specific mailing program (lotus-notes), but to do so, I need to create a Session with the application that usually was created using an ActiveXObject() object. The problem is that I won't be the end user of the website, and I do not want to create a website not user friendly, always asking for the user to add extensions in order to make the website functionalities work.

I am doing my best to find a workaround to the use of ActivateXObject(), encapsulating the application in the best way I can, so is there any kind of plugin that I can add through JavaScript to my website in order to use ActiveXObject() or any equivalent function?


回答1:


No, there isn't. To create a COM object (which is what ActiveXObject did), you'd need to use a browser with native support for ActiveX (old IE) or a browser you could use and/or write an old-style (NPAPI) "plugin" on.

All major browsers have discontinued or are actively (no pun) discontinuing support for the NPAPI plugin mechanism because of the security issues around it.

For instance, I think the SilverLight plugin might have been able to create COM objects, but as it's implemented as an NPAPI plugin, it is rapidly disappearing (and was EOL'd by Microsoft in 2012; they support SilverLight 5 through 2021, but that doesn't help you).

There is no replacement technology that can create COM objects from JavaScript code running in a web page in a standard browser at this time.




回答2:


I have a COM object that I call from a regular webpage using Javascript. I also do calls directly into a Domino database (the database used by IBM Notes).

What you could do is to write all your functionality on the server, then call the functions from the browser using Javascript. Simply build a wrapper around the functionality you want to expose to your web application. You can then perform Ajax calls to the server to do things or retrieve data.

You can find more info in the following two presentations:

http://blog.texasswede.com/mwlug-2015/

http://blog.texasswede.com/my-connect-2016-presentation-demo-database/



来源:https://stackoverflow.com/questions/37994417/encapsulate-activex-for-javascript

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