Open ww-k opened 3 years ago
I've been calling the nw executable directly with arguments. However have you tried the --args
argument with open?
I don't have a mac to try it this second. I thought you have to use the --args
argument with open.
open /Applications/nwjs.app --args xxx
I've been calling the nw executable directly with arguments. However have you tried the
--args
argument with open? I don't have a mac to try it this second. I thought you have to use the--args
argument with open.open /Applications/nwjs.app --args xxx
This can get xxx
on Mac, and get ['--args', 'xxx'] on Windows. But this example not match my sence.
I want call nwjs on browser by use url protocal. eg:
<a href="test-call-nwjs://xxx/yyy">call nwjs</a>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>demo</title>
</head>
<body>
<script>
const win = nw.Window.get();
win.showDevTools();
console.log('app start', nw.App.argv)
nw.App.on('open', args => {
console.log('app open fired', args);
});
</script>
</html>
Devtool console result: app start []
Devtool console result: app start ['test-call-nwjs://xxx/yyy']
NWJS Version : 0.55.0 Operating System : Mac
Expected behavior
nw.App.argv
contain actual argsHow to reproduce
open nwjs with index.html
Mac
open /Applications/nwjs.app xxx
Devtool console result: app start []
Windows
start D:\nwjs\nw.exe xxx
Devtool console result: app start [xxx]