title: How to Download current web-page
body: <p>i want to add a button to download  my html source code of a web page,
  i was able to do it but the problem is when i add a localhost url it works but when i add live url it open's the url instead of downloading it. so far i tried this</p>
  
  <pre><code> &lt;a download  href="http://localhost/test-new/"&gt;Download Source Code&lt;/a&gt;
  </code></pre>
  
  <p>i also tried this</p>
  
  <pre><code>&lt;button onclick="clicker()"&gt;Click me&lt;/button&gt;
  
  
  
  &lt;script type="text/javascript"&gt;
  
  function clicker() {
      var anchorTag = document.createElement('a');
      anchorTag.href = "http://localhost/test-new/";
      anchorTag.download = "download";
      anchorTag.click();
  
  
      var element = document.getElementById('divContainer');
      element.appendChild(anchorTag);
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>both of this working in localhost but not for live url. please help me</p>