Fixed document.location.protocol check from https to https: