Loading dll from Chrome extension

2019-07-31 13:37发布

I am trying to develop extensions for chrome and firefox that will communicate with my main program. I have developed a native library for the communication and in the extensions I just need to load the dll and call a method.

For Firefox I have no issue. I did it easily using ctypes.open("mydll.dll");

But for Chrome, as far as I know, currently there is no way to do that. because in one hand NPAPI is being phased out and in the other hand NaCI/ppapi runs in a sandbox.

Am I missing something or it's really impossible?

Thanks in advance.

2条回答
\"骚年 ilove
2楼-- · 2019-07-31 13:48

You probably should create an exe that wraps your DLL and then register it as a Native Messaging host. In your exe, you would parse the JSON sent from Chrome and convert it into variables that you pass to methods in the DLL.

查看更多
太酷不给撩
3楼-- · 2019-07-31 14:01

Native Messaging is the recommended solution for an extension that needs to communicate with an application.

查看更多
登录 后发表回答