2

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.

amirghi
  • 43
  • 2
  • 5

2 Answers2

1

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

smorgan
  • 20,228
  • 3
  • 47
  • 55
  • That's right. But the answer to my question is "yes"? so there is no way to load a dll from a chrome extension? because it's very important to me, I need to reuse the code. It would have lots of overhead to rewrite everything in Native Messaging. – amirghi Jan 17 '14 at 08:56
0

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.

dss539
  • 6,804
  • 2
  • 34
  • 64