var win = gui.Window.open('https://github.com', {
position: 'center',
width: 901,
height: 127
});
这将在新窗口中打开 URL,但如何在同一主窗口中打开(重定向)该 URL?
最佳答案
您可以使用普通的 HTML 窗口功能。
window.location.href = 'http://example.com';
请务必包含
node-remote: 'http://example.com'
在您的 package.json 中,如果您计划在加载该页面时使用默认的 nodewebkit 功能。
关于javascript - 如何在 Node-Webkit 中的同一窗口中打开 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29174575/