3

As we all know Google announced to remove NPAPI from Chrome on September 2015:

http://www.chromium.org/developers/npapi-deprecation

I have a plugin developed with NPAPI, which allows users to scan using WIA and TWAIN. I also use there WinApi do "draw" controls inside browser. Short research showed that alternatives like Native Client/Pepper and so on, do not allow direct access to WinApi.

As I understand the only alternative is to create separate application(e.g Windows Service) to call WinApi throw it, and use WebSockets for communication between Browser and Service. I also should replace HWND with HTML5 canvas drawing.

Please tell me, are there any other solutions for this situation ?

Armen Sarkisian
  • 95
  • 3
  • 10

1 Answers1

2

You're correct that there is no way to access WinAPi from a PPAPI plugin, and that you'll need a separate application to do that. The easiest way to communicate with a native application from a Chrome extension is Native Messaging:

https://developer.chrome.com/extensions/nativeMessaging

If you wish to draw on a page, you will have to use HTML. Alternatively, you could do your own drawing from a PPAPI plugin, but you would have to link a graphics library such as Cairo from NaClPorts:

https://code.google.com/p/naclports/wiki/PortList

It can be done (this is how the PDF plugin works in Chrome) but it is a lot more work.

bbudge
  • 1,127
  • 6
  • 7