0
votes

I am developing a web application that uses an extension to communicate with native application.

But I am getting undefined on chrome.extension.connectNative whereas simple connect is available.

For the same extension code, if i make it a "Chrome App", and connect from a page within the extension it is working fine.

Please help me with this issue.

Here is a diagrammatic form, (XXX) refers to the area where I am facing the problem.

My Web App --> javascript --> Chrome Extension (XXX)--> Native Host

I have check all the required permissions for my extension, and as I mentioned it works if I run the extension standalone.

I am reusing the code provided in original example: http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/

1

1 Answers

0
votes

Most chrome.* APIs are unavailable in a normal web-page context. If you want to use those APIs in your page, you'll want to send messages to your extension's background or event pages.