title: Check all links protocols and add https:
body: <p>I wanted to check if all links of a page have https:// or they just start with www. and if they don't have https:// just add it to them</p>
  <p>I'm stuck in the condition to check if they have https: or not and how to add them https:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.rest-web a').each(function(){
      console.log($(this).attr('href'));
      var link = $(this).attr('href');
      if(link.location.protocol !== 'https:'){
        console.log('no');
        
      } else {
        console.log('yes');
      }
    });</code></pre>
  </div>
  </div>
  </p>
  <p>Many thanks</p>