felipefss
felipefss

Reputation: 129

How to use the ChromeApp to connect to a node.js server?

I have a Node.js server and I'd like to know how I could do for the ChromeApp to work with it. I tried putting "http://localhost:3000" (server address) on the runtime:

chrome.app.runtime.onLaunched.addListener(function () {
   chrome.app.window.create('http://localhost:3000');
});

But it doesn't even launch. Does someone have an idea on what I could do? Thanks.

Upvotes: 2

Views: 722

Answers (1)

lostsource
lostsource

Reputation: 21820

You cannot launch external URLs with chrome.app.window.create. In fact if you check the chrome.runtime.lastError property you will see the following error:

The URL used for window creation must be local for security reasons.

I suggest you look into using the <webview> tag as it is much more appropriate for your use-case.

Upvotes: 3

Related Questions