should handle xdomain, if we are in the browser