Making extension work on both HTTP and HTTPS