Setting window.location.href = 'thepage.html' is the same as calling:
window.open('thepage.html', '_self');
I.e. the target is limited to the same window, as that is where the location property is. This has the same effect as clicking a link without a target attribute:
...
You can use the open method instead to specify a different target, like a new window:
window.open('thepage.html', '_blank');
This has the same effect as clicking a link with that target:
...
You can also use the open method to open a new window. The return value is a reference to the window, so you can use that to set the location of that window instead of the current window:
var w = window.open('about:blank', '_blank');
w.location.href = 'thepage.html';