Minor : use document.location.protocol