Z
Z
zxc762017-08-28 15:01:14
Node.js
zxc76, 2017-08-28 15:01:14

node webkit. How to connect nw.gui to the site?

Hello.
For example, if in the manifest we have:
"main": " https://site.ru/ "
Then you can't connect nw.gui:
var nw = require('nw.gui');
How to solve this problem?
Is it possible to compile Node-webkit and embed nw.gui into it to use it not locally?
Or maybe some library can be put directly on the site? And then connect in the same way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zxc76, 2017-08-28
@zxc76

For those who - well, really need it, I came up with an alternative solution.
We do it locally, index.html. From nw.gui.
It contains an iframe to the desired address.
Between the iframe and the page we forward the commands-messages through:
top.postMessage('GO_TREY', '*');
And in index.html we execute commands.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question