return popup;
The behavior of the windowFeatures string relies on specific formatting rules:
return popup;
window.open('https://example.com', 'myWindow', 'width=400,height=300,left=100,top=100');
Note: If you are using target="_blank" in HTML anchor tags ( <a> ), modern browsers now imply rel="noopener" by default, but window.open requires explicit definition in older browsers for full security.
To prevent this, you should include noopener or noreferrer in your features string.