chrome.runtime.connectNative

221 views
Skip to first unread message

Myer Nore

unread,
Feb 15, 2017, 5:14:31 PM2/15/17
to nw.js
Is there a list of chrome.* apis supported by nw.js anywhere? Like kyle.matt I am looking to use the Cisco Web Communicator Chrome Extension in a nw.js / electron / muon app. That extension specifically needs:
  1. chrome.runtime.connectNative(hostName) / nativeMessaging permission
  2. chrome.management.get() / management permission
  3. chrome.runtime.onConnect
  4. chrome.runtime.onConnectExternal
  5. chrome.extension.getURL
  6. chrome.extension.lastError
So far, I haven't been able to see any evidence that nw.js supports connectNative, but I'm not sure where to look, either.
Myer

Roger

unread,
Feb 15, 2017, 8:32:28 PM2/15/17
to Myer Nore, nw.js
NW supports all chrome.* APIs for the Chrome App platform, and some of the chrome.* APIs for the extension platform. For an official list, see http://docs.nwjs.io/en/latest/References/Chrome%20Extension%20APIs/

If you have APIs on the extension platform need to be supported, please file an issue and we'll fix it soon.

Roger

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel R. Baleato

unread,
Mar 2, 2017, 8:56:49 AM3/2/17
to nw.js
Hi Myer,

Were you able to make the extension communicate with the native application?

Roger Wang

unread,
Mar 5, 2017, 10:01:56 PM3/5/17
to nw.js

Myer Nore

unread,
Mar 8, 2017, 8:25:27 AM3/8/17
to Roger Wang, nw.js
Hi Daniel, I was not able to verify, because of the issue I mentioned in the thread nw --load-estension='/path/to/ppbllmlcmhfnfflbkbinnhacecaankdh' replacing id. Please update here or elsewhere on the mailing list if you are able to get connectNative to work.


--
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/52hjzwOMzUM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwjs-general+unsubscribe@googlegroups.com.

Daniel R. Baleato

unread,
Mar 21, 2017, 9:42:06 AM3/21/17
to nw.js, wen...@gmail.com
Hi,

In my case I needed to load an extension that needs to communicate with a native application.
In development I manage to do this by loading the extension with --load-extension=path/to/extension and specifying a data directory with --user-data-dir=UserDataDirectory. Then inside the UserDataDirectory there is the file manifest file for the native messaging host configuration (UserDataDirectory/NativeMessagingHosts/com.xxx.chrome.plugin.helper.json).

This manifest needs to allow an specific extension to access the native application. At the moment I'm forcing the loaded extension to have a predefined key by using the method described here. I don't know if there is a better way.
To unsubscribe from this group and all its topics, send an email to nwjs-general...@googlegroups.com.

Myer Nore

unread,
Apr 12, 2017, 11:27:30 AM4/12/17
to nw.js, wen...@gmail.com
Daniel, 
Thank you for your reply, which was very helpful to me. In my case, I was already using the Cisco Web Connector Chrome Extension to connect to the native Cisco Browser Extension. As I had that extension working in my local chrome, I wanted to do the same thing inside node webkit. 
  1. I found the extension at ~/Library/Application Support/Google/Chrome/Default/Extensions/ppbllmlcmhfnfflbkbinnhacecaankdh/ and copied the folder ppbllmlcmhfnfflbkbinnhacecaankdh/ to my nw.js project directory. This included the "key" that was appropriate for reproducing the id ppbllmlcmhfnfflbkbinnhacecaankdh.
  2. I found the original NativeMessagingHosts folder containing the original configuration for the cisco native client at ~/Library/Application Support/Google/Chrome/NativeMessagingHosts. I copied NativeMessagingHosts into my project directory from there.
  3. I read the nw.js docs on the --user-data-dir to find my user data directory at ~/Library/Application Support/<nw_manifest_name>. I copied NativeMessagingHosts into that folder.
  4. I ran nw with nw src/ --load-extension='/Users/username/path/to/proj/src/ppbllmlcmhfnfflbkbinnhacecaankdh' --remote-debugging-port=9222.
  5. This loaded the native client inside node webkit correctly, including video and audio through cisco.

Myer
Reply all
Reply to author
Forward
0 new messages