如何在Node-Webkit的同一窗口中打开URL?

时间:2015-03-20 19:37:56

标签: javascript node-webkit

var win = gui.Window.open('https://github.com', {
  position: 'center',
  width: 901,
  height: 127
});

这将在新窗口中打开URL,但是如何在同一主窗口中打开(重定向)URL?

1 个答案:

答案 0 :(得分:2)

您可以使用普通的HTML窗口函数。



window.location.href = 'http://example.com';




请务必加入



node-remote: 'http://example.com'




如果您计划在加载该页面时使用默认的nodewebkit功能,请在您的package.json中