use 'http' instead of location.protocol so that https links will also work.