The button triggers a template node (the blue one, not the orange one).
I am not able to make the site swap to work. So I am doing some tests.
Sending the url to a debug node also.
The difference between hostname and origin is that origin have the protocol (http:) at first, hostname has not.
When you link it to another site without the protocol it appends the url at the end of the same url.
So you get someurl.com/someurl.com
The problem with origin is that you also get the TCP port (eg :6000).
This I did not want since I wanted to link to another site with another port.
Also when using a button to trigger the linking in the template node, remember to do an if check (like a string sent from the button) in the script before sending the user to another side. Before window.open(some site)
If you dont, the javascript will execute the moment the user opens the site.