title: How to fetch URL of current Tab in my chrome extension using javascript
body: <p>I am just getting started with Google Chrome Extension development and my project involves making an extension which when clicked prints the URL of whichever page/tab is currently open. </p>
  
  <p>So if I am on google's home page and I click my extension, I need to get "<a href="https://www.google.com/" rel="noreferrer">https://www.google.com/</a>" as my output within the extension.</p>
  
  <p>I need to do this using javascript and am unable to find code which I understand and which does the job. I read about using "window.location" and "document.href" and stuff but won't that give me the url of just my extension and not the current tab? </p>
  
  <p>Please help me get started. Thanks in advance.</p>