minor thing, but this is confusing with no space between window.location.port: (doesn't look like the colon is a ternary expression operator)