update isCrossOrigin logic to be cleaner in coffeescript